Part Number Hot Search : 
0XW12 1N6007 70246 50150 120FIB LS430 18N65 TLOE1100
Product Description
Full Text Search
 

To Download ATXMEGA32D4-CU Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  features ? high-performance, low-power atmel ? avr ? xmega ? 8/16-bit microcontroller ? nonvolatile program and data memories ? 16k - 128kbytes of in-system self-programmable flash ? 4k - 8kbytes boot section ? 1k - 2kbytes eeprom ? 2k - 8kbytes internal sram ? peripheral features ? four-channel event system ? four 16-bit timer/counters three timer/counters with four output compare or input capture channels one timer/counter with two output compare or input capture channels high-resolution extension on two timer/counters advanced waveform extension (awex) on one timer/counter ? two usarts with irda support for one usart ? two two-wire interfaces with dual address match (i 2 c and smbus compatible) ? two serial peripheral interfaces (spis) ? crc-16 (crc-ccitt) and crc-32 (ieee 802.3) generator ? 16-bit real time counter (r tc) with separate oscillator ? one twelve-channel, 12-bit, 200ksp s analog to digital converter ? two analog comparators with window compare function, and current sources ? external interrupts on all general purpose i/o pins ? programmable watchdog timer with separate on-chip ultra low power oscillator ? qtouch ? library support capacitive touch buttons, sliders and wheels ? special microcontroller features ? power-on reset and programmable brown-out detection ? internal and external clock options with pll and prescaler ? programmable multilevel interrupt controller ? five sleep modes ? programming and debug interface pdi (program and debug interface) ? i/o and packages ? 34 programmable i/o pins ? 44 - lead tqfp ? 44 - pad vqfn/qfn ? 49 - ball vfbga ? operating voltage ? 1.6 ? 3.6v ? operating frequency ? 0 ? 12mhz from 1.6v ? 0 ? 32mhz from 2.7v typical applications ? industrial control ? climate control ? low power battery applications ? factory automation ? rf and zigbee ? ? power tools ? building control ? motor control ? hvac ? board control ? sensor control ? utility metering ? white goods ? optical ? medical applications 8/16-bit atmel xmega d4 microcontroller atxmega128d4 atxmega64d4 atxmega32d4 atxmega16d4 8135l?avr?06/12
2 8135l?avr?06/12 xmega d4 1. ordering information notes: 1. this device can also be supplied in wafer form. please contact your local atmel sales office for detailed ordering info rmation. 2. pb-free packaging, complies to the european directive for restriction of hazardous subst ances (rohs directive). also halide free and fully green. 3. for packaging information see ?packaging information? on page 61. 4. tape and reel. ordering code flash [bytes] eeprom [bytes] sram [bytes] speed [mhz] power supply package (1)(2)(3) temp. atxmega128d4-au 128k + 8k 2k 8k 32 1.6 - 3.6v 44a -40c - 85c atxmega128d4-aur (4) 128k + 8k 2k 8k atxmega64d4-au 64k + 4k 2k 4k atxmega64d4-aur (4) 64k + 4k 2k 4k atxmega32d4-au 32k + 4k 1k 4k atxmega32d4-aur (4) 32k + 4k 1k 4k atxmega16d4-au 16k + 4k 1k 2k atxmega16d4-aur (4) 16k + 4k 1k 2k atxmega128d4-mh 128k + 8k 2k 8k 44m1 atxmega128d4-mhr (4) 128k + 8k 2k 8k atxmega64d4-mh 64k + 4k 2k 4k atxmega64d4-mhr (4) 64k + 4k 2k 4k atxmega32d4-mh 32k + 4k 1k 4k atxmega32d4-mhr (4) 32k + 4k 1k 4k atxmega16d4-mh 16k + 4k 1k 2k atxmega16d4-mhr (4) 16k + 4k 1k 2k atxmega128d4-cu 128k + 8k 2k 8k 49c2 atxmega128d4-cur (4) 128k + 8k 2k 8k atxmega64d4-cu 64k + 4k 2k 4k atxmega64d4-cur (4) 64k + 4k 2k 4k ATXMEGA32D4-CU 32k + 4k 1k 4k ATXMEGA32D4-CUr (4) 32k + 4k 1k 4k atxmega16d4-cu 16k + 4k 1k 2k atxmega16d4-cur (4) 16k + 4k 1k 2k package type 44a 44-lead, 10 x 10mm body size, 1.0mm body thickness, 0.8mm l ead pitch, thin profile plastic quad flat package (tqfp) 44m1 44-pad, 7 x 7 x 1mm body, lead pitch 0.50mm, 5.20mm exposed pad, thermally enhanced plastic very thin quad no lead package (vqf n) 49c2 49-ball (7 x 7 array), 0.65mm pitch, 5.0 x 5.0 x 1.0mm, very thin, fine-pitch ball grid array package (vfbga)
3 8135l?avr?06/12 xmega d4 2. pinout/block diagram figure 2-1. block diagram and qfn/tqfp pinout. note: 1. for full details on pinout and pin functions refer to ?pinout and pin functions? on page 51 . 1 2 3 4 44 43 42 41 40 39 38 5 6 7 8 9 10 11 33 32 31 30 29 28 27 26 25 24 23 37 36 35 34 12 13 14 15 16 17 18 19 20 21 22 pa0 pa1 pa2 pa3 pa4 pb0 pb1 pb3 pb2 pa7 pa6 pa5 gnd vcc pc0 vdd gnd pc1 pc2 pc3 pc4 pc5 pc6 pc7 pd0 pd1 pd2 pd3 pd4 pd5 pd6 vcc gnd pd7 pe0 pe1 pe2 pe3 reset/pdi pdi pr0 pr1 avcc gnd power supervision port a event routing network bus matrix sram flash adc ac0:1 ocd port e port d prog/debug interface eeprom port c tc0:1 event system controller watchdog timer watchdog osc/clk control real time counter interrupt controller data bus data bus port r usart0 twi spi tc0 usart0 spi tc0 twi port b aref aref sleep controller reset controller ircom crc cpu internal references internal oscillators xosc tosc digital function analog function / oscillators programming, debug, test external clock / crystal pins general purpose i /o ground power
4 8135l?avr?06/12 xmega d4 figure 2-2. vfbga pinout. table 2-1. bga pinout. 1234 5 67 a pa3 avcc gnd pr1 pr0 pdi pe3 b pa4 pa1 pa0 gnd reset /pdi_clk pe2 vcc c pa5 pa2 pa6 pa7 gnd pe1 gnd d pb1 pb2 pb3 pb0 gnd pd7 pe0 e gnd gnd pc3 gnd pd4 pd5 pd6 f vcc pc0 pc4 pc6 pd0 pd1 pd3 g pc1pc2pc5pc7 gnd vccpd2 a b c d e f g 1 234567 a b c d e f g 765432 1 top view bottom view
5 8135l?avr?06/12 xmega d4 3. overview the atmel avr xmega is a family of low power, high performance, and peripheral rich 8/16-bit microcontrollers based on the avr enhanced risc arch itecture. by executing instructions in a single clock cycle, the avr xmega devices achi eve cpu throughput approaching one million instructions per second (mips) per megahertz, allowing the system designer to optimize power consumption versus processing speed. the avr cpu combines a rich instruction set with 32 general purpose working registers. all 32 registers are directly connected to the arithmetic logic unit (alu), allowing two independent reg- isters to be accessed in a single instruction, executed in one clock cycle. the resulting architecture is more code efficient while achi eving throughputs many times faster than conven- tional single-accumula tor or cisc based microcontrollers. the avr xmega d4 devices provide the following features: in-system programmable flash with read-while-write c apabilities; internal eeprom and sram; four-chann el event system and pro- grammable multilevel interrupt controller; 34 general purpose i/o lines; 16-bit real-time counter (rtc); four flexible, 16-bit timer/counters with compare and pwm channels; two usarts; two two-wire serial interfaces (twis); two serial peripheral interfaces (spis); one twelve-channel, 12- bit adc with programmable gain; two analog comparators (acs) with window mode; program- mable watchdog timer with separate internal oscilla tor; accurate internal oscillators with pll and prescaler; and programmable brown-out detection. the program and debug interface (pdi), a fast two-pin interface for programming and debug- ging, is available. the xmega d4 devices have five software selectable power saving modes. the idle mode stops the cpu while allowing the sram, event system , interrupt cont roller, and all peripherals to continue functioning. the power-down mode saves the sram and register contents, but stops the oscillators, disabling all ot her functions until the next twi, or pin-change interrupt, or reset. in power-save mode, the asynchronous real-time counter continues to run, allowing the applica- tion to maintain a timer base while the rest of the device is sleeping. in standby mode, the external crystal oscillator keeps running while the rest of the de vice is sleeping. this allows very fast startup from the external crystal, combined with low power consumption. in extended standby mode, both the main oscillator and the asynchronous timer continue to run. to further reduce power consumption, the peripheral clock to each individual peripheral can optionally be stopped in active mode and idle sleep mode. atmel offers a free qtouch library for embedding capacitive touch buttons, sliders and wheels functionality into avr microcontrollers. the devices are manufactured using atmel hi gh-density, nonvolatile memory technology. the program flash memory can be reprogrammed in-system through the pdi. a boot loader running in the device can use any interface to download the application program to the flash memory. the boot loader software in the boot flash section will conti nue to run while the application flash section is updated, providing true read-while-write operation. by combining an 8/16-bit risc cpu with in-system, self-programmable flash, the avr xmega is a powerful microcontroller family that provides a highly flexible and cost effective solution for many embedded applications. all atmel avr xmega devices are supported with a full suite of program and system develop- ment tools, including: c compilers, macro assemblers, program debugger/simulators, programmers, and evaluation kits.
6 8135l?avr?06/12 xmega d4 3.1 block diagram figure 3-1. xmega d4 block diagram. power supervision por/bod & reset port a (8) port b (4) sram adca aca ocd int. refs. pdi pa[0..7] pb[0..3] watchdog timer watchdog oscillator interrupt controller data bus prog/debug controller vcc gnd oscillator circuits/ clock generation oscillator control real time counter event system controller arefa arefb pdi_data reset/ pdi_clk sleep controller crc port c (8) pc[0..7] tcc0:1 usartc0 twic spic pd[0..7] pe[0..3] port d (8) tcd0 usartd0 spid tce0 twie port e (4) tempref vcc/10 port r (2) xtal/ tosc1 xtal2/ tosc2 pr[0..1] data bus nvm controller m o r p e e h s a l f ircom bus matrix cpu tosc1 tosc2 to clock generator event routing network digital function analog function programming, debug, test oscillator/crystal/clock general purpose i/o
7 8135l?avr?06/12 xmega d4 4. resources a comprehensive set of development tools, app lication notes and datasheets are available for download on http://www.atmel.com/avr . 4.1 recommended reading ? atmel avr xmega d manual ? xmega application notes this device data sheet only contains part specific information with a short description of each peripheral and module. the xmega d manual describes the modules and peripherals in depth. the xmega application notes contain example code and show applied use of the modules and peripherals. all documentation are available from www.atmel.com/avr . 5. capacitive touch sensing the atmel qtouch library provides a simple to use solution to realize touch sensitive interfaces on most atmel avr microcontrollers. the pat ented charge-transfer signal acquisition offers robust sensing and includes fully debounced reporting of touch keys and includes adjacent key suppression ? (aks ? ) technology for unambiguous detection of key events. the qtouch library includes support for the qtouch and qmatrix acquisition methods. touch sensing can be added to any application by linking the appropriate atmel qtouch library for the avr microcontroller. this is done by using a simple set of apis to define the touch chan- nels and sensors, and then calling the touch sens ing api?s to retrieve the channel information and determine the touch sensor states. the qtouch library is free and downloadable from the atmel website at the following location: www.atmel.com/qtouchlibrary . for implementation details and other information, refer to the qtouch library user guide - also available for download from the atmel website.
8 8135l?avr?06/12 xmega d4 6. avr cpu 6.1 features ? 8/16-bit, high-performan ce atmel avr risc cpu ? 137 instructions ? hardware multiplier ? 32x8-bit registers directly connected to the alu ? stack in ram ? stack pointer accessible in i/o memory space ? direct addressing of up to 16mb of program memory and 16mb of data memory ? true 16/24-bit access to 16/24-bit i/o registers ? efficient support for 8-, 16-, and 32-bit arithmetic ? configuration change protectio n of system-critical features 6.2 overview all atmel avr xmega devices use the 8/16-bit avr cpu. the main function of the cpu is to execute the code and perform all calculations. the cpu is able to access memories, perform calculations, control peripherals, and execute t he program in the flash memory. interrupt han- dling is described in a separate section, refer to ?interrupts and programmable multilevel interrupt controller? on page 28 . 6.3 architectural overview in order to maximize performance and parallelis m, the avr cpu uses a harvard architecture with separate memories and buses for program and data. instructions in the program memory are executed with single-level pipelining. wh ile one instruction is being executed, the next instruction is pre-fetched from the program memory. this enables instructions to be executed on every clock cycle. for details of all avr instructions, refer to http://www.atmel.com/avr . figure 6-1. block diagram of the avr cpu architecture.
9 8135l?avr?06/12 xmega d4 the arithmetic logic unit (alu) supports arit hmetic and logic operations between registers or between a constant and a register. single-register operations can also be executed in the alu. after an arithmetic operation, the status register is updated to reflect information about the result of the operation. the alu is directly connected to the fast-acces s register file. the 32 x 8-bit general purpose working registers all have single clock cycle acce ss time allowing single-cycle arithmetic logic unit (alu) operation between registers or between a register and an immediate. six of the 32 registers can be used as three 16-bit address po inters for program and data space addressing, enabling efficient address calculations. the memory spaces are linear. the data memory space and the program memory space are two different memory spaces. the data memory space is divided into i/o registers, sram, and external ram. in addition, the eeprom can be memory map ped in the data memory. all i/o status and control registers reside in the lowest 4kb addresses of the data memory. this is referred to as the i/o memory space. the lowe st 64 addresses can be accessed directly, or as the data space locations from 0x00 to 0x3f. the re st is the extended i/o memory space, ranging from 0x0040 to 0x0fff. i/o registers here must be accessed as data space locations using load (ld/lds/ldd) and store (s t/sts/std) instructions. the sram holds data. code execution from sram is not supported. it can easily be accessed through the five different addressing modes s upported in the avr architecture. the first sram address is 0x2000. data addresses 0x1000 to 0x1fff are reserved for memory mapping of eeprom. the program memory is divided in two sections, the application program section and the boot program section. both sections have dedicated lock bits for write and read/write protection. the spm instruction that is used for self-programmi ng of the application flash memory must reside in the boot program section. the application section contains an application table section with sep- arate lock bits for write and read/write protection. the application table section can be used for safe storing of nonvolatile data in the program memory. 6.4 alu - arithmetic logic unit the arithmetic logic unit (alu) supports arit hmetic and logic operations between registers or between a constant and a register. single-register operations can also be executed. the alu operates in direct connection with all 32 general purpose registers. in a single clock cycle, arith- metic operations between general purpose registers or between a register and an immediate are executed and the result is stored in the register file. after an arithmetic or logic operation, the status register is updated to reflect information about the result of the operation. alu operations are divided into three main categories ? arithmetic, logical, and bit functions. both 8- and 16-bit arithmetic is supported, and the instruction set allows for efficient implementa- tion of 32-bit aritmetic. the hardware multiplier supports signed and unsigned multiplication and fractional format. 6.4.1 hardware multiplier the multiplier is capable of multiplying two 8-bit numbers into a 16-bit result. the hardware mul- tiplier supports different variations of signed and unsigned integer and fractional numbers: ? multiplication of unsigned integers
10 8135l?avr?06/12 xmega d4 ? multiplication of signed integers ? multiplication of a signed integer with an unsigned integer ? multiplication of unsigned fractional numbers ? multiplication of signed fractional numbers ? multiplication of a signed fractional number with an unsigned one a multiplication takes two cpu clock cycles. 6.5 program flow after reset, the cpu starts to execute instructions from the lowest address in the flash program- memory ?0.? the program counter (pc) addresses the next instruction to be fetched. program flow is provided by conditional and unco nditional jump and call instructions capable of addressing the whole address space directly. most avr instructions use a 16-bit word format, while a limited number use a 32-bit format. during interrupts and subroutine calls, the return address pc is stored on the stack. the stack is allocated in the general data sram, and consequently the stack size is only limited by the total sram size and the usage of the sram. after reset, the stack pointer (sp) points to the highest address in the internal sram. the sp is read/write accessible in the i/o memory space, enabling easy implementation of multiple stacks or stack areas. the data sram can easily be accessed through the five different addressing modes supported in the avr cpu. 6.6 status register the status register (sreg) cont ains information about the result of the most recently executed arithmetic or logic instruction. this information can be used for altering program flow in order to perform conditional operations. note that the stat us register is updated after all alu operations, as specified in the instruction set reference. this will in many cases remove the need for using the dedicated compare instructions, resulting in faster and more compact code. the status register is not automatically stored when entering an interrupt routine nor restored when returning from an interrupt. this must be handled by software. the status register is accessible in the i/o memory space. 6.7 stack and stack pointer the stack is used for storing return addresses after interrupts and subroutine calls. it can also be used for storing temporary data. the stack pointer (sp) register always points to the top of the stack. it is implemented as two 8-bit registers t hat are accessible in the i/o memory space. data are pushed and popped from the stack using the push and pop instructions. the stack grows from a higher memory location to a lower memory location. this implies that pushing data onto the stack decreases the sp, and popping data off the stack increases the sp. the sp is auto- matically loaded after reset, and the initial value is the highest address of the internal sram. if the sp is changed, it must be set to point above address 0x2000, and it must be defined before any subroutine calls are executed or before interrupts are enabled. during interrupts or subroutine calls, the return address is automatically pushed on the stack. the return address can be two or three bytes, depending on program memory size of the device. for devices with 128kb or less of program memory, the return address is two bytes, and hence the stack pointer is decremented/incremented by two. for devices with more than 128kb of pro- gram memory, the return address is three bytes, and hence the sp is decremented/incremented
11 8135l?avr?06/12 xmega d4 by three. the return address is popped off the stack when returning from interrupts using the reti instruction, and from subroutine calls using the ret instruction. the sp is decremented by one when data are pushed on the stack with the push instruction, and incremented by one when data is popped off the stack using the pop instruction. to prevent corruption when updating the stack pointer from software, a write to spl will auto- matically disable interrupts for up to four instructions or until the next i/o memory write. after reset the stack pointer is initialized to the highest address of the sram. see figure 7-2 on page 15 . 6.8 register file the register file consists of 32 x 8-bit general purpose working registers with single clock cycle access time. the register file supports the following input/output schemes: ? one 8-bit output operand and one 8-bit result input ? two 8-bit output operands and one 8-bit result input ? two 8-bit output operands and one 16-bit result input ? one 16-bit output operand and one 16-bit result input six of the 32 registers can be used as three 16 -bit address register pointers for data space addressing, enabling efficient address calculati ons. one of these address pointers can also be used as an address pointer for look up tables in flash program memory.
12 8135l?avr?06/12 xmega d4 7. memories 7.1 features ? flash program memory ? one linear address space ? in-system programmable ? self-programming and boot loader support ? application section for applic ation code ? application table section for application code or data storage ? boot section for application code or boot loader code ? separate read/write protectio n lock bits for all sections ? built in fast crc check of a selectable flash program memory section ? data memory ? one linear address space ? single-cycle access from cpu ? sram ? eeprom byte and page accessible optional memory mapping for direct load and store ? i/o memory configuration and status register s for all peripherals and modules 16 bit-accessible general purpose registers for global variables or flags ? production signature row memory for factory programmed data ? id for each microcontroller device type ? serial number for each device ? calibration bytes for factory calibrated peripherals ? user signature row ? one flash page in size ? can be read and written from software ? content is kept after chip erase 7.2 overview the atmel avr architecture has two main memory spaces, the program memory and the data memory. executable code can reside only in the program memory, while data can be stored in the program memory and the data memory. the data memory includes the internal sram, and eeprom for nonvolatile data storage. all memo ry spaces are linear and require no memory bank switching. nonvolatile me mory (nvm) spaces can be locked for further write and read/write operations. this prevents unrestricted access to the application software. a separate memory section contains the fuse bytes. these are used for configuring important system functions, and can only be written by an external programmer. the available memory size c onfigurations are shown in ?ordering information? on page 2 in addition, each device has a flash memory signature row for calibration data, device identifica- tion, serial number etc.
13 8135l?avr?06/12 xmega d4 7.3 flash program memory the atmel avr xmega devices contain on-chip, in-system reprogrammable flash memory for program storage. the flash memory can be acce ssed for read and write from an external pro- grammer through the pdi or from application software running in the device. all avr cpu instructions are 16 or 32 bits wide, and each flash location is 16 bits wide. the flash memory is organized in two main sections, the application section and the boot loader sec- tion. the sizes of the different sections are fixed, but device-dependent. these two sections have separate lock bits, and can have different levels of protection. the store program memory (spm) instruction, which is used to write to the flash from the a pplication software, will only oper- ate when executed from the boot loader section. the application section contains an application table section with separate lock settings. this enables safe storage of nonvolatile data in the program memory. 7.3.1 application section the application section is the section of the flash that is used for storing the executable applica- tion code. the protection level for the application section can be selected by the boot lock bits for this section. the application section ca n not store any boot loader code since the spm instruction cannot be executed from the application section. 7.3.2 application table section the application table section is a part of the application section of the flash memory that can be used for storing data. the size is identical to the boot loader section. the protection level for the application table section can be selected by the boot lock bits for this section. the possibilities for different protection levels on the application section and the application table section enable safe parameter storage in the program memory. if this section is not used for data, application code can reside here. 7.3.3 boot loader section while the application section is used for storing the application code, the boot loader software must be located in the boot loader section because the spm instruction can only initiate pro- gramming when executing from this section. t he spm instruction can access the entire flash, including the boot loader section itself. the protection level for the boot loader section can be selected by the boot loader lock bits. if this se ction is not used for boot loader software, applica- tion code can be stored here. figure 7-1. flash program memory (hexadecimal address). word address 0 application section (128k/64k/32k/16k) ... efff / 77ff / 37ff / 17ff efff / f000 / 7800 / 3800 / 1800 f000 / application table section (4k/4k/4k/4k) ffff / 7fff / 3fff / 1fff ffff / 10000 / 8000 / 4000 / 2000 10000 / boot section (8k/4k/4k/4k) 10fff / 87ff / 47ff / 27ff 10fff /
14 8135l?avr?06/12 xmega d4 7.3.4 production signature row the production signature row is a separate memory section for factory programmed data. it con- tains calibration data for functions such as oscillators and analog modules. some of the calibration values will be automa tically loaded to th e corresponding module or peripheral unit during reset. other values must be loaded from the signature row and written to the correspond- ing peripheral registers from software. for details on calibration conditions, refer to ?electrical characteristics? on page 64 . the production signature row also contains an id that identifies each microcontroller device type and a serial number for each manufactured device. the serial number consists of the production lot number, wafer number, and wafer coordinates fo r the device. the device id for the available devices is shown in table 7-1 . the production signature row cannot be written or erased, but it can be read from application software and external programmers. table 7-1. device id bytes for atmel avr xmega d4 devices. 7.3.5 user signature row the user signature row is a separate memory section that is fully accessible (read and write) from application software and external programmers. it is one flash page in size, and is meant for static user parameter storage, such as cali bration data, custom serial number, identification numbers, random number seeds, etc. this section is not erased by chip erase commands that erase the flash, and requires a dedicated erase command. this ensures parameter storage dur- ing multiple program/erase operations and on-chip debug sessions. 7.4 fuses and lock bits the fuses are used to configure important system functions, and can only be written from an external programmer. the application software can read the fuses. the fuses are used to config- ure reset sources such as brownout detector and watchdog and startup configuration. the lock bits are used to set protection levels for the different flash sections (that is, if read and/or write access should be blocked). lock bits can be written by external programmers and application software, but only to stricter protection levels. chip erase is th e only way to erase the lock bits. to ensure that flash contents are protected even during chip erase, the lock bits are erased after the rest of the flash memory has been erased. an unprogrammed fuse or lock bit will have the value one, while a programmed fuse or lock bit will have the value zero. both fuses and lock bits are reprogrammable like the flash program memory. device device id bytes byte 2 byte 1 byte 0 atxmega16d4 42 94 1e atxmega32d4 42 95 1e atxmega64d4 47 96 1e atxmega128d4 47 97 1e
15 8135l?avr?06/12 xmega d4 7.5 data memory the data memory contains the i/o memory, internal sram, optionally memory mapped eeprom, and external memory if available. the data memory is organized as one continuous memory section, see figure 7-2 . to simplify development, i/o memory, eeprom and sram will always have the same start addres ses for all atmel avr xmega devices. 7.6 eeprom all devices have eeprom for nonvolatile data stor age. it is either addressable in a separate data space (default) or memory mapped and accessed in normal data space. the eeprom supports both byte and page access. memory mapped eeprom allows highly efficient eeprom reading and eeprom buffe r loading. when doing this, eeprom is accessible using load and store instruct ions. memory mapped eeprom will al ways start at hexadecimal address 0x1000. 7.7 i/o memory the status and configuration registers for peripherals and modules, including the cpu, are addressable through i/o memory locations. all i/o locations can be accessed by the load (ld/lds/ldd) and store (st/sts/std) instructions, which are used to transfer data between the 32 registers in the register file and the i/o memory. the in and out instructions can address i/o memory locations in the range of 0x00 to 0x3f directly. in the address range 0x00 - 0x1f, single-cycle instructions fo r manipulation and checking of individual bits are available. figure 7-2. data memory map (hexadecimal address). byte address atxmega64d4 byte address atxmega32d4 byte address atxmega16d4 0 i/o registers (4k) 0 i/o registers (4k) 0 i/o registers (4k) fff fff fff 1000 eeprom (2k) 1000 eeprom (1k) 1000 eeprom (1k) 17ff 13ff 13ff reserved reserved reserved 2000 internal sram (4k) 2000 internal sram (4k) 2000 internal sram (2k) 2fff 2fff 27ff byte address atxmega128d4 0 i/o registers (4k) fff 1000 eeprom (2k) 17ff reserved 2000 internal sram (8k) 3fff
16 8135l?avr?06/12 xmega d4 the i/o memory address for all peripherals and modules in xmega d4 is shown in the ?periph- eral module address map? on page 56 . 7.7.1 general purpose i/o registers the lowest 16 i/o memory addresses are reserved as general purpose i/o registers. these reg- isters can be used for storing global variables and flags, as they are direct ly bit-accessible using the sbi, cbi, sbis, an d sbic instructions. 7.8 data memory and bus arbitration since the data memory is organized as four se parate sets of memories, the bus masters (cpu, etc.) can access different memory sections at the same time. 7.9 memory timing read and write access to the i/o memory takes one cpu clock cycle. a write to sram takes one cycle, and a read from sr am takes two cycles. eeprom page load (write) takes one cycle, and three cycles are required for read. for bu rst read, new data are available every second cycle. refer to the instruction summary for more details on instructions and instruction timing. 7.10 device id and revision each device has a three-byte device id. this id identifies atmel as the manufacturer of the device and the device type. a separate register contains the revision number of the device. 7.11 i/o memory protection some features in the device are regarded as critical for safety in some applications. due to this, it is possible to lock the i/o register related to the clock system, the event system, and the advanced waveform extensions. as long as the lock is enabled, all related i/o registers are locked and they can not be written from the application software. the lock registers themselves are protected by the configuration change protection mechanism. 7.12 flash and eeprom page size the flash program memory and eeprom data memory are organi zed in pages. the pages are word accessible for the flash an d byte accessible for the eeprom. table 7-2 shows the flash program memory organization and program counter (pc) size. flash write and erase operations are performed on one page at a time, while reading the flash is done one byte at a time. for flash access the z-pointer (z[m:n]) is used for addressing. the most significant bits in the address (fpage) give the page number and the least significant address bits (fword) give the word in the page. table 7-2. number of words and pages in the flash. devices pc size flash size page size fword fpage application boot [bits] [bytes] [words] size no of pages size no of pages atxmega16d4 14 16k + 4k 128 z[6:0] z[13:7] 16k 64 4k 16 atxmega32d4 15 32k + 4k 128 z[6:0] z[14:7] 32k 128 4k 16 atxmega64d4 16 64k + 4k 128 z[6:0] z[15:7] 64k 256 4k 16 atxmega128d4 17 128k + 8k 128 z[8:0] z[16:7] 128k 512 8k 32
17 8135l?avr?06/12 xmega d4 table 7-3 shows eeprom memory orga nization. eeeprom write and erase operations can be performed one page or one byte at a time, while reading the eeprom is done one byte at a time. for eeprom access the nvm address regist er (addr[m:n]) is used for addressing. the most significant bits in the address (e2page) give the page number and the least significant address bits (e2byte) give the byte in the page. table 7-3. number of bytes and pages in the eeprom. devices eeprom page size e2byte e2page no of pages size [bytes] atxmega16d4 1k 32 addr[4:0] addr[10:5] 32 atxmega32d4 1k 32 addr[4:0] addr[10:5] 32 atxmega64d4 2k 32 addr[4:0] addr[10:5] 64 atxmega128d4 2k 32 addr[4:0] addr[10:5] 64
18 8135l?avr?06/12 xmega d4 8. event system 8.1 features ? system for direct peripheral-to-peripheral communication and signaling ? peripherals can directly send, recei ve, and react to peripheral events ? cpu independent operation ? 100% predictable signal timing ? short and guaranteed response time ? four event channels for up to four differ ent and parallel signal routing configurations ? events can be sent and/or used by most peripherals, clock system, and software ? additional functions include ? quadrature decoders ? digital filtering of i/o pin state ? works in active mode and idle sleep mode 8.2 overview the event system enables direct peripheral-to-peripheral communication and signaling. it allows a change in one peripheral?s state to automatically trigger actions in other peripherals. it is designed to provide a predictable system for short and predictable response times between peripherals. it allows for autonomous peripheral control and interaction without the use of inter- rupts or cpu resources, and is thus a powerful tool for reducing the complexity, size and execution time of application code. it also allows for synchronized timing of actions in several peripheral modules. a change in a peripheral?s state is referred to as an event, and usually corresponds to the peripheral?s interrupt conditions. events can be directly passed to other peripherals using a ded- icated routing network called the event routing network. how events are routed and used by the peripherals is configured in software. figure 8-1 on page 19 shows a basic diagram of all connected peripherals. the event system can directly connect together analog to digital co nverter, analog comparators, i/o port pins, the real-time counter, timer/counters, and ir communi cation module (ircom). events can also be generated from software and the peripheral clock.
19 8135l?avr?06/12 xmega d4 figure 8-1. event system overview and connected peripherals. the event routing network consis ts of four software-configurable multiplexers that control how events are routed and used. these are called event channels, and allow for up to four parallel event routing configurations. the maximum routi ng latency is two peripheral clock cycles. the event system works in both active mode and idle sleep mode. timer / counters adc real time counter port pins cpu / software ircom event routing network event system controller clk per prescaler ac
20 8135l?avr?06/12 xmega d4 9. system clock and clock options 9.1 features ? fast start-up time ? safe run-time clock switching ? internal oscillators: ? 32mhz run-time calibrate d and tuneable oscillator ? 2mhz run-time calibrated oscillator ? 32.768khz calibrated oscillator ? 32khz ultra low power (ulp) oscillator with 1khz output ? external clock options ? 0.4mhz - 16mhz cr ystal oscillator ? 32.768khz crystal oscillator ? external clock ? pll with 20mhz - 128mhz output frequency ? internal and external clock opti ons and 1x to 31x multiplication ? lock detector ? clock prescalers with 1x to 2048x division ? fast peripheral clocks running at two and four times the cpu clock ? automatic run-time calibration of internal oscillators ? external oscillator and pll lock failure dete ction with optional non-maskable interrupt 9.2 overview atmel avr xmega d4 devices have a flexible clo ck system supporting a large number of clock sources. it incorporat es both accurate internal oscillators and external crystal oscillator and res- onator support. a high-frequency phase locked lo op (pll) and clock prescalers can be used to generate a wide range of clock frequencies. a calibration feature (dfll) is available, and can be used for automatic run-time calibration of the internal oscillators to remove frequency drift over voltage and temperature. an oscillator failur e monitor can be enabled to issue a non-maskable interrupt and switch to the in ternal oscillator if the exte rnal oscillator or pll fails. when a reset occurs , all clock sources except the 32khz ul tra low power oscilla tor are disabled. after reset, the device will alwa ys start up running from the 2mhz internal oscillator. during nor- mal operation, the system clock source and pres calers can be changed from software at any time. figure 9-1 on page 21 presents the principal clock system in the xmega d4 family of devices. not all of the clocks need to be active at a gi ven time. the clocks for the cpu and peripherals can be stopped using sleep modes and power reduction registers, as described in ?power man- agement and sleep modes? on page 23 .
21 8135l?avr?06/12 xmega d4 figure 9-1. the clock system, clock sources and clock distribution. 9.3 clock sources the clock sources are divided in two main grou ps: internal oscillators and external clock sources. most of the clock sources can be directly enabled and disabled from software, while others are automatically enabled or disabled, depending on peripheral settings. after reset, the device starts up running from the 2mhz internal oscillator. the other clock sources, dflls and pll, are turned off by default. the internal osc illators do not require any external components to run. for details on character- istics and accuracy of the internal osc illators, refer to the device datasheet. real time counter peripherals ram avr cpu non-volatile memory watchdog timer brown-out detector system clock prescalers system clock multiplexer (sclksel) pllsrc rtcsrc div32 32 khz int. ulp 32.768 khz int. osc 32.768 khz tosc 2 mhz int. osc 32 mhz int. osc 0.4 ? 16 mhz xtal div32 div32 div4 xoscsel pll tosc1 tosc2 xtal1 xtal2 clk sys clk rtc clk per2 clk per clk cpu clk per4
22 8135l?avr?06/12 xmega d4 9.3.1 32khz ultra low power internal oscillator this oscillator provides an approximate 32khz cl ock. the 32khz ultra low power (ulp) internal oscillator is a very low power cl ock source, and it is not designe d for high accuracy. the oscilla- tor employs a built-in prescaler that provides a 1khz output. the os cillator is automatically enabled/disabled when it is used as clock source for any part of the device. this oscillator can be selected as the clock source for the rtc. 9.3.2 32.768khz calibrated internal oscillator this oscillator provides an appr oximate 32.768khz clock. it is calibrated during production to provide a default frequency close to its nominal frequency. the calibration register can also be written from software for run-time calibration of the o scillator frequency. t he oscillator employs a built-in prescaler, which provides both a 32.768khz output and a 1.024khz output. 9.3.3 32.768khz crystal oscillator a 32.768khz crystal oscillator can be connec ted between the tosc1 and tosc2 pins and enables a dedicated low fr equency oscillator input circuit. a low power mode with reduced volt- age swing on tosc2 is available. this oscillator can be used as a clock source for the system clock and rtc, and as the dfll reference clock. 9.3.4 0.4 - 16mhz crystal oscillator this oscillator can operate in four different modes optimized fo r different freque ncy ranges, all within 0.4 - 16mhz. 9.3.5 2mhz run-time calibrated internal oscillator the 2mhz run-time calibrated inte rnal oscillator is the default sy stem clock source after reset. it is calibrated during production to provide a default frequency close to its nominal frequency. a dfll can be enabled fo r automatic run-time ca libration of the oscillato r to compensate for tem- perature and vo ltage drift and optimize the oscillator accuracy. 9.3.6 32mhz run-time calibrated internal oscillator the 32mhz run-time calibrated internal oscillator is a high-frequency oscill ator. it is calibrated during production to provide a default frequency close to its nominal frequency. a digital fre- quency looked loop (dfl l) can be enabled for au tomatic run-time calibra tion of the oscillator to compensate for temperature and voltage drift and optim ize the oscillator accuracy. this oscilla- tor can also be adjusted and calibrated to any frequency between 30mhz and 55mhz. 9.3.7 external clock sources the xtal1 and xtal2 pins can be us ed to drive an external oscilla tor, either a quartz crystal or a ceramic resonator. xtal1 can be used as input for an external clock signal. the tosc1 and tosc2 pins is dedicated to driv ing a 32.768khz crystal oscillator. 9.3.8 pll with 1x-31x multiplication factor the built-in phase locked loop (pll) can be used to generate a high-frequency system clock. the pll has a user-selectable multiplication factor of from 1 to 31. in combination with the pres- calers, this gives a wide range of output frequencies from all clock sources.
23 8135l?avr?06/12 xmega d4 10. power management and sleep modes 10.1 features ? power management for adjusting power consumption and functions ? five sleep modes ?idle ?power down ? power save ?standby ? extended standby ? power reduction register to disable clock and tu rn off unused peripherals in active and idle modes 10.2 overview various sleep modes and clock gating are provided in order to tailor power consumption to appli- cation requirements. this enables the atmel avr xmega microcontroller to stop unused modules to save power. all sleep modes are available and can be entered from active mode. in active mode, the cpu is executing application code. when the device enters sleep mode, program execution is stopped and interrupts or a reset is used to wake the device again. the applicat ion code decides which sleep mode to enter and when. interrupts from enabled peripherals and all enabled reset sources can restore the microcontroller from sleep to active mode. in addition, power reduction registers provide a method to stop the clock to individual peripherals from software. when this is done, the current state of the peripheral is frozen, and there is no power consumption from that peripheral. this reduces the power consumption in active mode and idle sleep modes and enables much more fine-tuned power management than sleep modes alone. 10.3 sleep modes sleep modes are used to shut down modules and clock domains in the microcontroller in order to save power. xmega microcontrollers have five different sleep modes tuned to match the typ- ical functional stages during application execution. a dedicated sleep instruction (sleep) is available to enter sleep mode. interrupts are us ed to wake the device from sleep, and the avail- able interrupt wake-up sources are dependent on the configured sleep mode. when an enabled interrupt occurs, the device will wake up and exec ute the interrupt service routine before con- tinuing normal program execution from the first inst ruction after the sleep instruction. if other, higher priority interrupts are pending when the wake-up occurs, their interrupt service routines will be executed according to their priority before the interrupt service routine for the wake-up interrupt is executed. after wake-up, the cpu is halted for four cycles before execution starts. the content of the register file, sram and registers are kept during sleep. if a reset occurs dur- ing sleep, the device will reset, start up, and execute from the reset vector. 10.3.1 idle mode in idle mode the cpu and nonvolatile memory are stopped (note that any ongoing programming will be completed), but all peripherals, including the interrupt controller, and event system are kept running. any enabled interrupt will wake the device.
24 8135l?avr?06/12 xmega d4 10.3.2 power-down mode in power-down mode, all clocks, including the real-time counter clock source, are stopped. this allows operation only of asynchronous modules that do not require a running clock. the only interrupts that can wake up the mcu are the two-wire interface address match interrupt, and asynchronous port interrupts. 10.3.3 power-save mode power-save mode is identical to power down, with one exception. if the real-time counter (rtc) is enabled, it will keep running during sleep, and th e device can also wake up from either an rtc overflow or compare match interrupt. 10.3.4 standby mode standby mode is identical to power down, with the exception that the enabled system clock sources are kept running while the cpu, peripheral, and rtc clocks are stopped. this reduces the wake-up time. 10.3.5 extended standby mode extended standby mode is identical to power-save mode, with the exception that the enabled system clock sources are kept running while the cpu and peripheral clocks are stopped. this reduces the wake-up time.
25 8135l?avr?06/12 xmega d4 11. system control and reset 11.1 features ? reset the microcontroller and set it to in itial state when a re set source goes active ? multiple reset sources that cover different situations ?power-on reset ? external reset ? watchdog reset ? brownout reset ? pdi reset ? software reset ? asynchronous operation ? no running system clock in the device is required for reset ? reset status register for reading the reset source from the application code 11.2 overview the reset system issues a microcontroller reset and sets the device to its initial state. this is for situations where operation should not start or c ontinue, such as when the microcontroller oper- ates below its power supply rating. if a reset source goes active, the device enters and is kept in reset until all reset sources have released their reset. the i/o pins are immediately tri-stated. the program counter is set to the reset vector location, and all i/o registers are set to their initial values. the sram content is kept. however, if the device accesses the sram when a reset occurs, the content of the accessed location can not be guaranteed. after reset is released from all reset sources, the default oscillator is started and calibrated before the device starts running from the reset vector address. by default, this is the lowest pro- gram memory address, 0, but it is possible to move the reset vector to the lowest address in the boot section. the reset functionality is asynchronous, and so no running system clock is required to reset the device. the software reset feature makes it possible to issue a controlled system reset from the user software. the reset status register has individual status flags for each reset source. it is cleared at power- on reset, and shows which sources have issued a reset since the last power-on. 11.3 reset sequence a reset request from any reset so urce will immediately reset the device and keep it in reset as long as the request is active. when all reset r equests are released, t he device will go through three stages before the device starts running again: ?reset counter delay ?oscillator startup ?oscillator calibration if another reset requests occurs during this pr ocess, the reset sequence will start over again.
26 8135l?avr?06/12 xmega d4 11.4 reset sources 11.4.1 power-on reset a power-on reset (por) is generated by an on-chi p detection circuit. the por is activated when the v cc rises and reaches the por threshold voltage (v pot ), and this will start the reset sequence. the por is also activated to power down the device properly when the v cc falls and drops below the v pot level. the v pot level is higher for falling v cc than for rising v cc . consult the datasheet for por char- acteristics data. 11.4.2 brownout detection the on-chip brownout detection (bod) circuit monitors the v cc level during operation by com- paring it to a fixed, programmable level t hat is selected by the bodl evel fuses. if disabled, bod is forced on at the lowest level during chip erase and when the pdi is enabled. 11.4.3 external reset the external reset circuit is connected to th e external reset pin. the external reset will trigger when the reset pin is driven below the reset pin threshold voltage, v rst , for longer than the minimum pulse period, t ext . the reset will be held as long as the pin is kept low. the reset pin includes an internal pull-up resistor. 11.4.4 watchdog reset the watchdog timer (wdt) is a system function for monitoring correct program operation. if the wdt is not reset from the software within a programmable timeout period, a watchdog reset will be given. the watchdog re set is active for one to two clock cycl es of the 2mhz internal oscillator. for more details see ?wdt ? watchdog timer? on page 27 . 11.4.5 software reset the software reset makes it possible to issue a sy stem reset from software by writing to the soft- ware reset bit in the reset control register.t he reset will be issued within two cpu clock cycles after writing the bit. it is not possible to execute any instruction from when a software reset is requested until it is issued. 11.4.6 program and debug interface reset the program and debug interface reset contains a separate reset source that is used to reset the device during external programming and debuggin g. this reset source is accessible only from external debuggers and programmers.
27 8135l?avr?06/12 xmega d4 12. wdt ? watchdog timer 12.1 features ? issues a device reset if the timer is not reset before its timeout period ? asynchronous operation fr om dedicated oscillator ? 1khz output of the 32khz ultra low power oscillator ? 11 selectable timeout periods, from 8ms to 8s ? two operation modes: ? normal mode ? window mode ? configuration lock to prevent unwanted changes 12.2 overview the watchdog timer (wdt) is a system function for monitoring correct program operation. it makes it possible to recover from error situat ions such as runaway or deadlocked code. the wdt is a timer, configured to a predefined timeout period, and is constantly running when enabled. if the wdt is not reset within the timeout period, it will issue a microcontroller reset. the wdt is reset by executing the wdr (watchdog timer reset) instruction from the application code. the window mode makes it possible to define a time slot or window inside the total timeout period during which wdt must be reset. if the wd t is reset outside this window, either too early or too late, a system reset will be issued. compared to the normal mode, this can also catch sit- uations where a code error causes constant wdr execution. the wdt will run in active mode and all sleep modes, if enabled. it is asynchronous, runs from a cpu-independent clock source, and will continue to operate to issue a system reset even if the main clocks fail. the configuration change protection mechanism ensures that the wdt settings cannot be changed by accident. for increased safety, a fuse for locking the wdt settings is also available.
28 8135l?avr?06/12 xmega d4 13. interrupts and programmable mu ltilevel interrupt controller 13.1 features ? short and predictable interrupt response time ? separate interrupt configuration and vector address for each interrupt ? programmable multilevel interrupt controller ? interrupt prioritizing according to level and vector address ? three selectable interrupt levels for all interrupts: low, medium and high ? selectable, round-robin priority scheme within low-level interrupts ? non-maskable interrupts for critical functions ? interrupt vectors optionally pl aced in the application section or the boot loader section 13.2 overview interrupts signal a change of state in peripherals, and this can be used to alter program execu- tion. peripherals can have one or more interrupts, and all are individually enabled and configured. when an inte rrupt is enabled and co nfigured, it will generat e an interr upt request when the interrupt condition is present. the pr ogrammable multilevel inte rrupt controller (pmic) controls the handling and prioritizing of interrup t requests. when an interrupt request is acknowl- edged by the pmic, the program counter is set to point to the interrupt vector, and the interrupt handler can be executed. all peripherals can select between three different priority levels for their interrupts: low, medium, and high. interrupts are prioritized according to their level and their interrupt vector address. medium-level interrupts will interrupt low-level in terrupt handlers. high-level interrupts will inter- rupt both medium- and low-level interrupt handlers. within each level, the interrupt priority is decided from the interrupt vector address, where the lowest interrupt vector address has the highest interrupt priority. low-level interrupts have an optional round-robin scheduling scheme to ensure that all interrupts are serviced within a certain amount of time. non-maskable interrupts (nmi) are also supported, and can be used for system critical functions. 13.3 interrupt vectors the interrupt vector is the sum of the peripheral?s base interrupt address and the offset address for specific interrupts in each peripheral. the base addresses for the atmel avr xmega d4 devices are shown in table 13-1 . offset addresses for each interrupt available in the peripheral are described for each peripheral in the xmega d manual. for peripherals or modules that have only one interrupt, the interrupt vector is shown in table 13-1 . the program address is the word address. table 13-1. reset and interrupt vectors. program address (base address) source interrupt description 0x000 reset 0x002 oscf_int_vect crystal oscillator failure interrupt vector (nmi) 0x004 portc_int_base port c interrupt base 0x008 portr_int_base port r interrupt base 0x014 rtc_int_base real time counter interrupt base
29 8135l?avr?06/12 xmega d4 0x018 twic_int_base two-wire interface on port c interrupt base 0x01c tcc0_int_base timer/counter 0 on port c interrupt base 0x028 tcc1_int_base timer/counter 1 on port c interrupt base 0x030 spic_int_vect spi on port c interrupt vector 0x032 usartc0_int_base usart 0 on port c interrupt base 0x040 nvm_int_base non-volatile memory interrupt base 0x044 portb_int_base port b interrupt base 0x056 porte_int_base port e interrupt base 0x05a twie_int_base two-wire interface on port e interrupt base 0x05e tce0_int_base timer/counter 0 on port e interrupt base 0x080 portd_int_base port d interrupt base 0x084 porta_int_base port a interrupt base 0x088 aca_int_base analog comparator on port a interrupt base 0x08e adca_int_base analog to digital converter on port a interrupt base 0x09a tcd0_int_base timer/counter 0 on port d interrupt base 0x0ae spid_int_vector spi on port d interrupt vector 0x0b0 usartd0_int_base usart 0 on port d interrupt base table 13-1. reset and interrupt vectors. (continued) program address (base address) source interrupt description
30 8135l?avr?06/12 xmega d4 14. i/o ports 14.1 features ? 34 general purpose input and output pins with individual configuration ? output driver with configurable driver and pull settings: ? totem-pole ? wired-and ?wired-or ? bus-keeper ? inverted i/o ? input with synchronous and/or asynchronous sensing with interrupts and events ? sense both edges ? sense rising edges ? sense falling edges ? sense low level ? optional pull-up and pull-down resistor on input and wired-or/and configurations ? optional slew rate control ? asynchronous pin change sensing that can wake the device from all sleep modes ? two port interrupts with pin masking per i/o port ? efficient and safe access to port pins ? hardware read-modify-write through dedicated togg le/clear/set registers ? configuration of multiple pins in a single operation ? mapping of port registers in to bit-accessible i/o memory space ? peripheral clocks output on port pin ? real-time counter cloc k output to port pin ? event channels can be output on port pin ? remapping of digital peripheral pin functions ? selectable usart, spi, and timer/ counter input/output pin locations 14.2 overview one port consists of up to eight port pins: pin 0 to 7. each port pin can be configured as input or output with configurable driver and pull settings . they also implement synchronous and asyn- chronous input sensing with interrupts and events for selectable pin change conditions. asynchronous pin-change sensing means that a pin change can wake the device from all sleep modes, included the modes wh ere no clocks are running. all functions are individual and configurable per pin, but several pins can be configured in a sin- gle operation. the pins have hardware read- modify-write (rmw) functionality for safe and correct change of drive value and/or pull resistor configuration. the direction of one port pin can be changed without unintentionally changing the direction of any other pin. the port pin configuration also controls input and output selection of other device functions. it is possible to have both the peripheral clock and the real-time clock output to a port pin, and avail- able for external use. the same applies to events from the event system that can be used to synchronize and control external functions. other digital peripherals, such as usart, spi, and timer/counters, can be remapped to selectable pin locations in order to optimize pin-out versus application needs. the notation of the ports are porta, portb, portc, portd, porte, and portr.
31 8135l?avr?06/12 xmega d4 14.3 output driver all port pins (pn) have programmable output configuration. the port pins also have configurable slew rate limitation to reduce electromagnetic emission. 14.3.1 push-pull figure 14-1. i/o configuration - totem-pole. 14.3.2 pull-down figure 14-2. i/o configuration - totem-pole with pull-down (on input). 14.3.3 pull-up figure 14-3. i/o configuration - totem-pole with pull-up (on input). inn outn dirn pn inn outn dirn pn inn outn dirn pn
32 8135l?avr?06/12 xmega d4 14.3.4 bus-keeper the bus-keeper?s weak output produces the same logi cal level as the last output level. it acts as a pull-up if the last leve l was ?1?, and pull-down if the last level was ?0?. figure 14-4. i/o configuration - totem-pole with bus-keeper. 14.3.5 others figure 14-5. output configuration - wired-or with optional pull-down. figure 14-6. i/o configuration - wired-and with optional pull-up. inn outn dirn pn inn outn pn inn outn pn
33 8135l?avr?06/12 xmega d4 14.4 input sensing input sensing is synchronous or asynchronous depending on the enabled clock for the ports, and the configuration is shown in figure 14-7 . figure 14-7. input sensing system overview. when a pin is configured with inverted i/o, the pin value is inverted before the input sensing. 14.5 alternate port functions most port pins have alternate pin functions in addition to being a general purpose i/o pin. when an alternate function is enabled, it might override the normal port pin function or pin value. this happens when other peripherals that require pins are enabled or configured to use pins. if and how a peripheral will override and use pins is described in the section for that peripheral. ?pinout and pin functions? on page 51 shows which modules on peripherals that enable alternate func- tions on a pin, and which alternate functions that are available on a pin. inverted i/o interrupt control ireq event pn d q r d q r synchronizer inn edge detect asynchronous sensing synchronous sensing edge detect
34 8135l?avr?06/12 xmega d4 15. tc0/1 ? 16-bit timer/counter type 0 and 1 15.1 features ? four 16-bit timer/counters ? three timer/counters of type 0 ? one timer/counter of type 1 ? split-mode enabling two 8-bit timer/co unter from each timer/counter type 0 ? 32-bit timer/counte r support by cascading two timer/counters ? up to four compare or capture (cc) channels ? four cc channels for ti mer/counters of type 0 ? two cc channels for timer/counters of type 1 ? double buffered timer period setting ? double buffered capture or compare channels ? waveform generation: ? frequency generation ? single-slope pulse width modulation ? dual-slope pulse width modulation ? input capture: ? input capture with noise cancelling ? frequency capture ? pulse width capture ? 32-bit input capture ? timer overflow and er ror interrupts/events ? one compare match or input capture interrupt/event per cc channel ? can be used with event system for: ? quadrature decoding ? count and direction control ?capture ? high-resolution extension ? increases frequency and waveform reso lution by 4x (2-bi t) or 8x (3-bit) ? advanced waveform extension: ? low- and high-side output with pr ogrammable dead-time insertion (dti) ? event controlled fault protection for safe disabling of drivers 15.2 overview atmel avr xmega devices have a set of four flexible 16-bit timer/counters (tc). their capabil- ities include accurate program execution timing, frequency and waveform generation, and input capture with time and frequency measurement of digital signals. two timer/counters can be cas- caded to create a 32-bit timer/counter with optional 32-bit capture. a timer/counter consists of a base counter and a set of compare or capture (cc) channels. the base counter can be used to count clock cycles or events. it has direction control and period set- ting that can be used for timing. the cc channels can be used together with the base counter to do compare match control, frequency generation, and pulse width waveform modulation, as well as various input capture operations. a timer/counter can be configured for either capture or com- pare functions, but cannot perform both at the same time. a timer/counter can be clocked and timed from the peripheral clock with optional prescaling or from the event system. the event system can also be used for direction control and capture trig- ger or to synchronize operations. there are two differences between timer/counter type 0 and type 1. timer/counter 0 has four cc channels, and timer/counter 1 has two cc channe ls. all information related to cc channels 3
35 8135l?avr?06/12 xmega d4 and 4 is valid only for timer/counter 0. only timer/counter 0 has the split mode feature that split it into two 8-bit timer/counters with four compare channels each. some timer/counters have extensions to enable more specialized waveform and frequency gen- eration. the advanced waveform extension (awex) is intended for motor control and other power control applications. it enables low- and high-side output with dead-time insertion, as well as fault protection for disabling and shutting down external drivers. it can also generate a syn- chronized bit pattern across the port pins. the advanced waveform extensi on can be enabled to provide extra and more advanced fea- tures for the timer/counter. this are onl y available for timer/counter 0. see ?awex ? advanced waveform extension? on page 37 for more details. the high-resolution (hi-res) extension can be used to increase the waveform output resolution by four or eight times by using an internal clo ck source running up to four times faster than the peripheral clock. see ?hi-res ? high resolution extension? on page 38 for more details. figure 15-1. overview of a timer/counter and closely related peripherals. portc has one timer/counter 0 and one timer/counter1. portd and porte each has one timer/conter0. notation of these are tcc0 (time/counter c0), tcc1, tcd0 and tce0, respectively. awex compare/capture channel d compare/capture channel c compare/capture channel b compare/capture channel a waveform generation buffer comparator hi-res fault protection capture control base counter counter control logic timer period prescaler dead-time insertion pattern generation clk per4 port event system clk per timer/counter
36 8135l?avr?06/12 xmega d4 16. tc2 - timer/counter type 2 16.1 features ? six eight-bit timer/counters ? three low-byte timer/counter ? three high-byte timer/counter ? up to eight compare channels in each timer/counter 2 ? four compare channels for the low-byte timer/counter ? four compare channels for the high-byte timer/counter ? waveform generation ? single slope pulse width modulation ? timer underflow interrupts/events ? one compare match interrupt/event per compar e channel for the low-byte timer/counter ? can be used with the even t system for count control 16.2 overview there are three timer/counter 2. these are realized when a timer/counter 0 is set in split mode. it is then a system of two eight-bit timer/counters, each with four compare channels. this results in eight configurable pulse width modula tion (pwm) channels with individually controlled duty cycles, and is intended for applications that require a high number of pwm channels. the two eight-bit timer/counters in this system are referred to as the low-byte timer/counter and high-byte timer/counter, respectively. the differ ence between them is that only the low-byte timer/counter can be used to generate compare match interrupts and events. the two eight-bit timer/counters have a shared clock source and separate period and compare settings. they can be clocked and timed from the peripheral clock, with optional prescaling, or from the event sys- tem. the counters are always counting down. portc, portd and porte each has one timer/counter 2. notation of these are tcc2 (time/counter c2), tcd2 and tce2, respectively.
37 8135l?avr?06/12 xmega d4 17. awex ? advanced waveform extension 17.1 features ? waveform output with complementar y output from each compare channel ? four dead-time inser tion (dti) units ? 8-bit resolution ? separate high and low side dead-time setting ? double buffered dead time ? optionally halts timer during dead-time insertion ? pattern generation unit creating synchronised bit pattern across the port pins ? double buffered pattern generation ? optional distribution of one compare channel output across the port pins ? event controlled fault protection for in stant and predictable fault triggering 17.2 overview the advanced waveform extension (awex) provides extra functions to the timer/counter in waveform generation (wg) modes. it is primarily intended for use with different types of motor control and other power control applications. it ena bles low- and high side output with dead-time insertion and fault protection for disabling and shutting down external drivers. it can also gener- ate a synchronized bit pattern across the port pins. each of the waveform generator outputs from the timer/counter 0 are split into a complimentary pair of outputs when any awex features are enabled. these output pairs go through a dead- time insertion (dti) unit that generates the non-inverted low side (ls) and inverted high side (hs) of the wg output with dead-time insertion between ls and hs switching. the dti output will override the normal port value acco rding to the port override setting. the pattern generation unit can be used to generate a synchronized bit pattern on the port it is connected to. in addition, the wg output from compare channel a can be distributed to and override all the port pins. when the pattern generat or unit is enabled, the dti unit is bypassed. the fault protection unit is conn ected to the event system, enablin g any event to trigger a fault condition that will disabl e the awex output. the event system ensures predictable and instant fault reaction, and gives flexibility in the selection of fault triggers. the awex is available for tcc0. the notation of this is awexc.
38 8135l?avr?06/12 xmega d4 18. hi-res ? high r esolution extension 18.1 features ? increases waveform generator reso lution up to 8x (three bits) ? supports frequency, single-slope pwm, and dual-slope pwm generation ? supports the awex when this is used for the same timer/counter 18.2 overview the high-resolution (hi-res) extension can be used to increase the resolution of the waveform generation output from a timer/counter by four or eight. it can be used for a timer/counter doing frequency, single-slope pwm, or dual-slope pw m generation. it can also be used with the awex if this is used for the same timer/counter. the hi-res extension uses the peripheral 4x clock (clk per4 ). the system clock prescalers must be configured so the peripheral 4x clock frequency is four times higher than the peripheral and cpu clock frequency when the hi-res extension is enabled. there is one hi-res extension that can be enabled for the timer/counter pair on portc. the notation of this is hiresc.
39 8135l?avr?06/12 xmega d4 19. rtc ? 16-bit real-time counter 19.1 features ? 16-bit resolution ? selectable clock source ? 32.768khz external crystal ? external clock ? 32.768khz internal oscillator ? 32khz internal ulp oscillator ? programmable 10-bit clock prescaling ? one compare register ? one period register ? clear counter on period overflow ? optional interrupt/event on overflow and compare match 19.2 overview the 16-bit real-time counter (rtc) is a counter that typically runs continuously, including in low- power sleep modes, to keep track of time. it ca n wake up the device from sleep modes and/or interrupt the device at regular intervals. the reference clock is typically the 1.024khz output from a high-accuracy crystal of 32.768khz, and this is the configuration most optimized for low power consumption. the faster 32.768khz output can be selected if the rtc needs a resolution higher than 1ms. the rtc can also be clocked from an external clock signal, the 32.768khz internal oscillator or the 32khz internal ulp oscillator. the rtc includes a 10-bit programmable prescaler that can scale down the reference clock before it reaches the counter. a wide range of resolutions and time-out periods can be config- ured. with a 32.768khz clock source, the maximu m resolution is 30.5s, and time-out periods can range up to 2000 seconds. with a resolution of 1s, the maximum timeout period is more than18 hours (65536 seconds). the rtc can give a compare interrupt and/or event when the counter equals the compare register value, and an overflow interrupt and/or event when it equals the period register value. figure 19-1. real-time counter overview. 32.768khz crystal osc 32.768khz int. osc tosc1 tosc2 external clock div32 div32 32khz int ulp (div32) rtcsrc 10-bit prescaler clk rtc cnt per comp = = ?match?/ compare top/ overflow
40 8135l?avr?06/12 xmega d4 20. twi ? two-wire interface 20.1 features ? two identical two-wire interface peripherals ? bidirectional, two-wire communication interface ? phillips i 2 c compatible ? system management bus (smbus) compatible ? bus master and slave operation supported ? slave operation ? single bus master operation ? bus master in multi-master bus environment ? multi-master arbitration ? flexible slave address match functions ? 7-bit and general call address recognition in hardware ? 10-bit addressing supported ? address mask register for dual a ddress match or address range masking ? optional software address recognitio n for unlimited number of addresses ? slave can operate in all sleep modes, including power-down ? slave address match can wake device from all sleep modes ? 100khz and 400khz bus frequency support ? slew-rate limited output drivers ? input filter for bus noise and spike suppression ? support arbitration between start/repeated start and data bit (smbus) ? slave arbitration allows support for ad dress resolve protocol (arp) (smbus) 20.2 overview the two-wire interface (twi) is a bidirectional , two-wire communication interface. it is i 2 c and system management bus (smbus) compatible. the only external hardware needed to imple- ment the bus is one pull-up resistor on each bus line. a device connected to the bus must act as a master or a slave. the master initiates a data trans- action by addressing a slave on the bus and telling whet her it wants to trans mit or receive data. one bus can have many slaves and one or several masters that can take control of the bus. an arbitration process handles priority if more than one master tries to transmit data at the same time. mechanisms for resolving bus contention are inherent in the protocol. the twi module supports master and slave functionality. the master and slave functionality are separated from each other, and can be enabled and configured separately. the master module supports multi-master bus operation and arbitration. it contains the baud rate generator. both 100khz and 400khz bus frequency is supported. quick command and smart mode can be enabled to auto-trigger operations and reduce software complexity. the slave module implements 7-bit address match and general address call recognition in hard- ware. 10-bit addressing is also supported. a dedicated address mask register can act as a second address match register or as a register for address range masking. the slave continues to operate in all sleep modes, including power-down mode. this enables the slave to wake up the device from all sleep modes on twi address match. it is possible to disable the address matching to let this be handled in software instead. the twi module will detect start and stop condi tions, bus collisions, and bus errors. arbitra- tion lost, errors, collision, and cl ock hold on the bus ar e also detected and indicated in separate status flags available in both master and slave modes.
41 8135l?avr?06/12 xmega d4 it is possible to disable the twi drivers in the device, and enable a four-wire digital interface for connecting to an external twi bus driver. this can be used for applications where the device operates from a different v cc voltage than used by the twi bus. portc and porte each has one twi. notation of these peripherals are twic and twie.
42 8135l?avr?06/12 xmega d4 21. spi ? serial peripheral interface 21.1 features ? two identical spi peripherals ? full-duplex, three-wire synchronous data transfer ? master or slave operation ? lsb first or msb first data transfer ? eight programmable bit rates ? interrupt flag at th e end of transmission ? write collision flag to indicate data collision ? wake up from idle sleep mode ? double speed master mode 21.2 overview the serial peripheral interfac e (spi) is a high-speed synchronous data transfer interface using three or four pins. it allows fast communication between an atmel avr xmega device and peripheral devices or between several microcontrollers. the spi supports full-duplex communication. a device connected to the bus must act as a master or slave. the master initiates and controls all data transactions. portc and portd each has one spi. notation of these peripherals are spic and spid.
43 8135l?avr?06/12 xmega d4 22. usart 22.1 features ? two identical usart peripherals ? full-duplex operation ? asynchronous or synchronous operation ? synchronous clock rates up to 1/ 2 of the device clock frequency ? asynchronous clock rates up to 1/8 of the device clock frequency ? supports serial frames with 5, 6, 7, 8, or 9 data bits and 1 or 2 stop bits ? fractional baud rate generator ? can generate desired baud rate from any system clock frequency ? no need for external oscillator with certain frequencies ? built-in error detection and correction schemes ? odd or even parity generation and parity check ? data overrun and framing error detection ? noise filtering includes false start bit detection and digital low-pass filter ? separate interrupts for ? transmit complete ? transmit data register empty ? receive complete ? multiprocessor co mmunication mode ? addressing scheme to address a specific devices on a multidevice bus ? enable unaddressed devices to automatically ignore all frames ? master spi mode ? double buffered operation ? operation up to 1/2 of th e peripheral clock frequency ? ircom module for irda compliant pulse modulation/demodulation 22.2 overview the universal synchronous and asynchronous seri al receiver and transmitter (usart) is a fast and flexible serial communication module. the usart supports full-duplex communication and asynchronous and synchronous operation. the usart can be configured to operate in spi master mode and used for spi communication. communication is frame based, and the frame format can be customized to support a wide range of standards. the usart is buffered in both directions, enabling continued data transmis- sion without any delay between frames. separat e interrupts for receive and transmit complete enable fully interrupt driven communication. frame error and buffer overflow are detected in hardware and indicated with separate status flags. even or odd parity generation and parity check can also be enabled. the clock generator includes a fractional baud rate generator that is able to generate a wide range of usart baud rates from any system cloc k frequencies. this removes the need to use an external crystal oscillator wit h a specific frequency to achiev e a required baud rate. it also supports external clock input in synchronous slave operation. when the usart is set in master spi mode, all usart-specific logic is disabled, leaving the transmit and receive buffers, shift registers, and baud rate generator enabled. pin control and interrupt generation are identical in both modes. the registers are used in both modes, but their functionality differs for some control settings. an ircom module can be enabled for one usart to support irda 1.4 physical compliant pulse modulation and demodulation for baud rates up to 115.2kbps. portc and portd each has one usart. notation of these peripherals are usartc0 and usartd0 respectively.
44 8135l?avr?06/12 xmega d4 23. ircom ? ir communication module 23.1 features ? pulse modulation/demodulation for infrared communication ? irda compatible for baud rates up to 115.2kbps ? selectable pulse modulation scheme ? 3/16 of the baud rate period ? fixed pulse period, 8-bit programmable ? pulse modulation disabled ? built-in filtering ? can be connected to and used by any usart 23.2 overview atmel avr xmega devices contain an infrared communication module (ircom) that is irda compatible for baud rates up to 115.2kbps. it can be connected to any usart to enable infra- red pulse encoding/decoding for that usart.
45 8135l?avr?06/12 xmega d4 24. crc ? cyclic redundancy check generator 24.1 features ? cyclic redundancy check (crc) generation and checking for ? communication data ? program or data in flash memory ? data in sram and i/o memory space ? integrated with flash memory and cpu ? automatic crc of the complete or a selectable range of the flash memory ? cpu can load data to the crc ge nerator through the i/o interface ? crc polynomial software selectable to ? crc-16 (crc-ccitt) ? crc-32 (ieee 802.3) ? zero remainder detection 24.2 overview a cyclic redundancy check (crc) is an error detection technique test algorithm used to find accidental errors in data, and it is commonly used to determine the correctness of a data trans- mission, and data present in the data and program memories. a crc takes a data stream or a block of data as input and generates a 16- or 32-bit output that can be appended to the data and used as a checksum. when the same data are later received or read, the device or application repeats the calculation. if the new crc result does not match the one calculated earlier, the block contains a data error. the application will then detect this and may take a corrective action, such as requesting the data to be sent again or simply not using the incorrect data. typically, an n-bit crc applied to a data block of arbitrary length will detect any single error burst not longer than n bits (any single alteration that spans no more than n bits of the data), and will detect the fraction 1-2 -n of all longer error bursts. the crc module in atmel avr xmega devices supports two commonly used crc po lynomials; crc-16 (crc-ccitt) and crc-32 (ieee 802.3). ? crc-16: ? crc-32: polynomial: x 16 + x 12 + x 5 +1 hex value: 0x1021 polynomial: x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x +1 hex value: 0x04c11db7
46 8135l?avr?06/12 xmega d4 25. adc ? 12-bit analog to digital converter 25.1 features ? one analog to digital converter (adc) ? 12-bit resolution ? up to 200 thousand samples per second ? down to 3.6s conversion time with 8-bit resolution ? down to 5.0s conversion ti me with 12-bit resolution ? differential and si ngle-ended input ? up to 12 single-ended inputs ? 12x4 differential inputs without gain ? 8x4 differential inputs with gain ? built-in differential gain stage ? 1/2 x, 1x, 2x, 4x, 8x, 16x, 32x, and 64x gain options ? single, continuous and scan conversion options ? three internal inputs ? internal temperature sensor ?v cc voltage divided by 10 ? 1.1v bandgap voltage ? internal and external reference options ? compare function for accurate monito ring of user defined thresholds ? optional event triggered co nversion for accurate timing ? optional interrupt/even t on compare result 25.2 overview the adc converts analog signals to digital values . the adc has 12-bit resolution and is capable of converting up to 200 thosuand samples per second (ksps). the input selection is flexible, and both single-ended and differential measurements can be done. for differential measurements, an optional gain stage is availabl e to increase the dynamic range. in addition, several internal signal inputs are available. the adc can provide both signed and unsigned results. the adc measurements can either be started by application software or an incoming event from another peripheral in the device. the adc measur ements can be started with predictable timing, and without software intervention. both internal and external reference voltages can be used. an integrated temperature sensor is available for use with the adc. the v cc /10 and the bandgap voltage can also be measured by the adc. the adc has a compare function for accurate monitoring of user defined thresholds with mini- mum software intervention required.
47 8135l?avr?06/12 xmega d4 figure 25-1. adc overview. the adc may be configured for 8- or 12-bit result, reducing the minimum conversion time (prop- agation delay) from 5.0s for 12-bit to 3.6s for 8-bit result. adc conversion results are provided left- or right adjusted with optional ?1? or ?0? padding. this eases calculation when the result is represented as a signed integer (signed 16-bit number). porta has one adc. notation of this peripheral is adca. ch0 result compare register < > threshold (int req) internal 1.00v internal vcc/1.6v arefa arefb v inp v inn internal signals internal vcc/2 adc0 adc11 ? ? ? adc0 adc7 ? ? ? reference voltage adc
48 8135l?avr?06/12 xmega d4 26. ac ? analog comparator 26.1 features ? two analog comparators ? selectable hysteresis ?no ?small ?large ? analog comparator output available on pin ? flexible input selection ? all pins on the port ? bandgap reference voltage ? a 64-level programmable voltage scaler of the internal v cc voltage ? interrupt and event generation on: ? rising edge ? falling edge ?toggle ? window function interrupt and event generation on: ? signal above window ? signal inside window ? signal below window ? constant current source with configurable output pin selection 26.2 overview the analog comparator (ac) compares the voltage levels on two inputs and gives a digital out- put based on this comparison. the analog comparator may be configured to generate interrupt requests and/or events upon several different combinations of input change. the analog comparator hysteresis can be adjusted in order to achieve the optimal operation for each application. the input selection includes analog port pins, several internal signals, and a 64-level program- mable voltage scaler. the analog comparator output state can also be output on a pin for use by external devices. a constant current source can be enabled and output on a selectable pin. this can be used to replace, for example, external resistors used to charge capacitors in capacitive touch sensing applications. the analog comparators are always grouped in pairs on each port. these are called analog comparator 0 (ac0) and analog comparator 1 (ac1). they have identical behavior, but separate control registers. used as pair, they can be set in window mode to compare a signal to a voltage range instead of a voltage level. porta has one ac pair. notation is aca.
49 8135l?avr?06/12 xmega d4 figure 26-1. analog comparator overview. the window function is realized by connecting the external inputs of the two analog comparators in a pair as shown in figure 26-2 . figure 26-2. analog comparator window function. acnmuxctrl acnctrl interrupt mode enable enable hysteresis hysteresis ac1out winctrl interrupt sensititivity control & window function events interrupts ac0out pin input pin input pin input pin input voltage scaler bandgap + ac0 - + ac1 - ac0 + - ac1 + - input signal upper limit of window lower limit of window interrupt sensitivity control interrupts events
50 8135l?avr?06/12 xmega d4 27. programming and debugging 27.1 features ? programming ? external programming through pdi minimal protocol overhead for fast operation built-in error detection and handling for reliable operation ? boot loader support for programming through any comm unication interface ? debugging ? nonintrusive, real-ti me, on-chip debug system ? no software or hardware resources required from device except pin connection ? program flow control go, stop, reset, step into, step over, step out, run-to-cursor ? unlimited number of user program breakpoints ? unlimited number of user data breakpoints, break on: data location read, write, or both read and write data location content equa l or not equal to a value data location content is grea ter or smaller than a value data location content is within or outside a range ? no limitation on device clock frequency ? program and debug interface (pdi) ? two-pin interface for extern al programming and debugging ? uses the reset pin and a dedicated pin ? no i/o pins required during programming or debugging 27.2 overview the program and debug interface (pdi) is an atmel proprietary interface for external program- ming and on-chip debugging of a device. the pdi supports fast programming of nonvolatile memory (nvm ) spaces; flash, eepom, fuses, lock bits, and the user signature row. debug is supported through an on-chip debug syste m that offers nonintrusive, real-time debug. it does not require any software or hardware resources except for the device pin connection. using the atmel tool chain, it offers complete program flow control and support for an unlimited number of program and complex data breakpoints. application debug can be done from a c or other high-level language source code level, as well as from an assembler and disassembler level. programming and debugging can be done through the pdi physical layer. this is a two-pin inter- face that uses the reset pin for the clock input (pdi_clk) and one other dedicated pin for data input and output (pdi_data). any external programmer or on-chip debugger/emulator can be directly connected to this interface.
51 8135l?avr?06/12 xmega d4 28. pinout and pin functions the device pinout is shown in ?pinout/block diagram? on page 3 . in addition to general purpose i/o functionality, each pin can have several al ternate functions. this will depend on which peripheral is enabled and connected to the actual pin. only one of the pin functions can be used at time. 28.1 alternate pin f unction description the tables below show the notation for all pin functions available and describe its function. 28.1.1 operation/power supply 28.1.2 port interrupt functions 28.1.3 analog functions 28.1.4 timer/counter and awex functions v cc digital supply voltage av cc analog supply voltage gnd ground sync port pin with full synchronous and limited asynchronous interrupt function async port pin with full syn chronous and full asynchro nous interrupt function acn analog comparator input pin n acnout analog comparator n output adcn analog to digital converter input pin n a ref analog reference input pin ocnxls output compare channel x low side for timer/counter n ocnxhs output compare channel x high side for timer/counter n
52 8135l?avr?06/12 xmega d4 28.1.5 communication functions 28.1.6 oscillators, clock and event 28.1.7 debug/system functions scl serial clock for twi sda serial data for twi sclin serial clock in for twi when external driver interface is enabled sclout serial clock out for twi when external driver interface is enabled sdain serial data in for twi when external driver interface is enabled sdaout serial data out for twi when ex ternal driver interface is enabled xckn transfer clock for usart n rxdn receiver data for usart n txdn transmitter data for usart n ss slave select for spi mosi master out slave in for spi miso master in slave out for spi sck serial clock for spi toscn timer oscillator pin n xtaln input/output for oscillator pin n clkout peripheral clock output evout event channel output rtcout rtc clock source output reset reset pin pdi_clk program and debug interface clock pin pdi_data program and debug interface data pin
53 8135l?avr?06/12 xmega d4 28.2 alternate pin functions the tables below show the primary/default function for each pin on a port in the first column, the pin number in the second column, and then all alternate pin functions in the remaining columns. the head row shows what peripheral that enable and use the alternate pin functions. for better flexibility, some alternate functions also have selectable pin locations for their func- tions, this is noted under the first table where this apply. table 28-1. port a - alternate functions. port a pin # interrupt adca pos/gainpos adca neg adca gainneg aca pos aca neg aca out refa gnd 38 avcc 39 pa0 40 sync adc0 adc0 ac0 ac0 aref pa1 41 sync adc1 adc1 ac1 ac1 pa2 42 sync/async adc2 adc2 ac2 pa3 43 sync adc3 adc3 ac3 ac3 pa4 44 sync adc4 adc4 ac4 pa5 1 sync adc5 adc5 ac5 ac5 pa6 2 sync adc6 adc6 ac6 ac1out pa7 3 sync adc7 adc7 ac7 ac0out table 28-2. port b - alternate functions. port b pin # interrupt adca pos refb pb0 4 sync adc8 aref pb1 5 sync adc9 pb2 6 sync/async adc10 pb3 7 sync adc11
54 8135l?avr?06/12 xmega d4 notes: 1. pin mapping of all tc0 can optionally be moved to high nibble of port. 2. if tc0 is configured as tc2 all eight pins can be used for pwm output. 3. pin mapping of all usart0 can optionally be moved to high nibble of port. 4. pins mosi and sck for all spi can optionally be swapped. 5. clkout can optionally be moved between port c, d and e and between pin 4 and 7. 6. evout can optionally be moved between port c, d and e and between pin 4 and 7. table 28-3. port c - alternate functions. port c pin # interrupt tcc0 (1)(2) awexc tcc1 usartc0 (3) spic (4) twic clockout (5) eventout (6) gnd 8 vcc 9 pc0 10 sync oc0a oc0als sda pc1 11 sync oc0b oc0ahs xck0 scl pc2 12 sync/async oc0c oc0bls rxd0 pc3 13 sync oc0d oc0bhs txd0 pc4 14 sync oc0cls oc1a ss pc5 15 sync oc0chs oc1b mosi pc6 16 sync oc0dls miso clk rtc pc7 17 sync oc0dhs sck clk per evout table 28-4. port d - alternate functions. port d pin # interrupt tcd0 usartd0 spid clockout eventout gnd 18 vcc 19 pd0 20 sync oc0a pd1 21 sync oc0b xck0 pd2 22 sync/async oc0c rxd0 pd3 23 sync oc0d txd0 pd4 24 sync ss pd5 25 sync mosi pd6 26 sync miso pd7 27 sync sck clk per evout table 28-5. port e - alternate functions. port e pin # interrupt tce0 twie pe0 28 sync oc0a sda pe1 29 sync oc0b scl gnd 30 vcc 31 pe2 32 sync/async oc0c pe3 33 sync oc0d
55 8135l?avr?06/12 xmega d4 note: 1. tosc pins can optionally be moved to pe2/pe3. table 28-6. port r- alternate functions. port r pin # interrupt pdi xtal tosc (1) pdi 34 pdi_data reset 35 pdi_clock pro 36 sync xtal2 tosc2 pr1 37 sync xtal1 tosc1
56 8135l?avr?06/12 xmega d4 29. peripheral modu le address map the address maps show the base address for each peripheral and module in atmel avr xmega d4. for complete register description and summary for each peripheral module, refer to the xmega d manual. base address name description 0x0000 gpio general purpose io registers 0x0010 vport0 virtual port 0 0x0014 vport1 virtual port 1 0x0018 vport2 virtual port 2 0x001c vport3 virtual port 3 0x0030 cpu cpu 0x0040 clk clock control 0x0048 sleep sleep controller 0x0050 osc oscillator control 0x0060 dfllrc32m dfll for the 32mhz internal oscillator 0x0068 dfllrc2m dfll for the 2mhz internal oscillator 0x0070 pr power reduction 0x0078 rst reset controller 0x0080 wdt watch-dog timer 0x0090 mcu mcu control 0x00a0 pmic programmable multilevel interrupt controller 0x00b0 portcfg port configuration 0x00d0 crc crc module 0x0180 evsys event system 0x01c0 nvm non volatile memory (nvm) controller 0x0200 adca analog to digital converter on port a 0x0380 aca analog comparator pair on port a 0x0400 rtc real time counter 0x0480 twic two wire interface on port c 0x04a0 twie two wire interface on port e 0x0600 porta port a 0x0620 portb port b 0x0640 portc port c 0x0660 portd port d 0x0680 porte port e 0x07e0 portr port r 0x0800 tcc0 timer/counter 0 on port c 0x0840 tcc1 timer/counter 1 on port c 0x0880 awexc advanced waveform extension on port c 0x0890 hiresc high resolution extension on port c 0x08a0 usartc0 usart 0 on port c 0x08c0 spic serial peripheral interface on port c 0x08f8 ircom infrared communication module 0x0900 tcd0 timer/counter 0 on port d 0x09a0 usartd0 usart 0 on port d 0x09c0 spid serial peripheral interface on port d 0x0a00 tce0 timer/counter 0 on port e
57 8135l?avr?06/12 xmega d4 30. instruction set summary mnemonics operands description operation flags #clocks arithmetic and logic instructions add rd, rr add without carry rd rd + rr z,c,n,v,s,h 1 adc rd, rr add with carry rd rd + rr + c z,c,n,v,s,h 1 adiw rd, k add immediate to word rd rd + 1:rd + k z,c,n,v,s 2 sub rd, rr subtract without carry rd rd - rr z,c,n,v,s,h 1 subi rd, k subtract immediate rd rd - k z,c,n,v,s,h 1 sbc rd, rr subtract with carry rd rd - rr - c z,c,n,v,s,h 1 sbci rd, k subtract immediate with carry rd rd - k - c z,c,n,v,s,h 1 sbiw rd, k subtract immediate from word rd + 1:rd rd + 1:rd - k z,c,n,v,s 2 and rd, rr logical and rd rd ? rr z,n,v,s 1 andi rd, k logical and with immediate rd rd ? k z,n,v,s 1 or rd, rr logical or rd rd v rr z,n,v,s 1 ori rd, k logical or with immediate rd rd v k z,n,v,s 1 eor rd, rr exclusive or rd rd rr z,n,v,s 1 com rd one?s complement rd $ff - rd z,c,n,v,s 1 neg rd two?s complement rd $00 - rd z,c,n,v,s,h 1 sbr rd,k set bit(s) in register rd rd v k z,n,v,s 1 cbr rd,k clear bit(s) in register rd rd ? ($ffh - k) z,n,v,s 1 inc rd increment rd rd + 1 z,n,v,s 1 dec rd decrement rd rd - 1 z,n,v,s 1 tst rd test for zero or minus rd rd ? rd z,n,v,s 1 clr rd clear register rd rd rd z,n,v,s 1 ser rd set register rd $ff none 1 mul rd,rr multiply unsigned r1:r0 rd x rr (uu) z,c 2 muls rd,rr multiply signed r1:r0 rd x rr (ss) z,c 2 mulsu rd,rr multiply signed with unsigned r1:r0 rd x rr (su) z,c 2 fmul rd,rr fractional multiply unsigned r1:r0 rd x rr<<1 (uu) z,c 2 fmuls rd,rr fractional multiply signed r1:r0 rd x rr<<1 (ss) z,c 2 fmulsu rd,rr fractional multiply signed with unsigned r1:r0 rd x rr<<1 (su) z,c 2 branch instructions rjmp k relative jump pc pc + k + 1 none 2 ijmp indirect jump to (z) pc(15:0) pc(21:16) z, 0 none 2 eijmp extended indirect jump to (z) pc(15:0) pc(21:16) z, eind none 2 jmp k jump pc k none 3 rcall k relative call subroutine pc pc + k + 1 none 2 / 3 (1) icall indirect call to (z) pc(15:0) pc(21:16) z, 0 none 2 / 3 (1) eicall extended indirect call to (z) pc(15:0) pc(21:16) z, eind none 3 (1) call k call subroutine pc k none 3 / 4 (1)
58 8135l?avr?06/12 xmega d4 ret subroutine return pc stack none 4 / 5 (1) reti interrupt return pc stack i 4 / 5 (1) cpse rd,rr compare, skip if equal if (rd = rr) pc pc + 2 or 3 none 1 / 2 / 3 cp rd,rr compare rd - rr z,c,n,v,s,h 1 cpc rd,rr compare with carry rd - rr - c z,c,n,v,s,h 1 cpi rd,k compare with immediate rd - k z,c,n,v,s,h 1 sbrc rr, b skip if bit in register cleared if (rr(b) = 0) pc pc + 2 or 3 none 1 / 2 / 3 sbrs rr, b skip if bit in register set if (rr(b) = 1) pc pc + 2 or 3 none 1 / 2 / 3 sbic a, b skip if bit in i/o register cleared if (i/o(a,b) = 0) pc pc + 2 or 3 none 2 / 3 / 4 sbis a, b skip if bit in i/o register set if (i/o(a,b) =1) pc pc + 2 or 3 none 2 / 3 / 4 brbs s, k branch if status flag set if (sreg(s) = 1) then pc pc + k + 1 none 1 / 2 brbc s, k branch if status flag cleared if (sreg(s) = 0) then pc pc + k + 1 none 1 / 2 breq k branch if equal if (z = 1) then pc pc + k + 1 none 1 / 2 brne k branch if not equal if (z = 0) then pc pc + k + 1 none 1 / 2 brcs k branch if carry set if (c = 1) then pc pc + k + 1 none 1 / 2 brcc k branch if carry cleared if (c = 0) then pc pc + k + 1 none 1 / 2 brsh k branch if same or higher if (c = 0) then pc pc + k + 1 none 1 / 2 brlo k branch if lower if (c = 1) then pc pc + k + 1 none 1 / 2 brmi k branch if minus if (n = 1) then pc pc + k + 1 none 1 / 2 brpl k branch if plus if (n = 0) then pc pc + k + 1 none 1 / 2 brge k branch if greater or equal, signed if (n v= 0) then pc pc + k + 1 none 1 / 2 brlt k branch if less than, signed if (n v= 1) then pc pc + k + 1 none 1 / 2 brhs k branch if half carry flag set if (h = 1) then pc pc + k + 1 none 1 / 2 brhc k branch if half carry flag cleared if (h = 0) then pc pc + k + 1 none 1 / 2 brts k branch if t flag set if (t = 1) then pc pc + k + 1 none 1 / 2 brtc k branch if t flag cleared if (t = 0) then pc pc + k + 1 none 1 / 2 brvs k branch if overflow flag is set if (v = 1) then pc pc + k + 1 none 1 / 2 brvc k branch if overflow flag is cleared if (v = 0) then pc pc + k + 1 none 1 / 2 brie k branch if interrupt enabled if (i = 1) then pc pc + k + 1 none 1 / 2 brid k branch if interrupt disabled if (i = 0) then pc pc + k + 1 none 1 / 2 data transfer instructions mov rd, rr copy register rd rr none 1 movw rd, rr copy register pair rd+1:rd rr+1:rr none 1 ldi rd, k load immediate rd k none 1 lds rd, k load direct from data space rd (k) none 2 (1)(2) ld rd, x load indirect rd (x) none 1 (1)(2) ld rd, x+ load indirect and post-increment rd x (x) x + 1 none 1 (1)(2) ld rd, -x load indirect and pre-decrement x x - 1, rd (x) x - 1 (x) none 2 (1)(2) ld rd, y load indirect rd (y) (y) none 1 (1)(2) ld rd, y+ load indirect and post-increment rd y (y) y + 1 none 1 (1)(2) mnemonics operands description operation flags #clocks
59 8135l?avr?06/12 xmega d4 ld rd, -y load indirect and pre-decrement y rd y - 1 (y) none 2 (1)(2) ldd rd, y+q load indirect with displacement rd (y + q) none 2 (1)(2) ld rd, z load indirect rd (z) none 1 (1)(2) ld rd, z+ load indirect and post-increment rd z (z), z+1 none 1 (1)(2) ld rd, -z load indirect and pre-decrement z rd z - 1, (z) none 2 (1)(2) ldd rd, z+q load indirect with displacement rd (z + q) none 2 (1)(2) sts k, rr store direct to data space (k) rd none 2 (1) st x, rr store indirect (x) rr none 1 (1) st x+, rr store indirect and post-increment (x) x rr, x + 1 none 1 (1) st -x, rr store indirect and pre-decrement x (x) x - 1, rr none 2 (1) st y, rr store indirect (y) rr none 1 (1) st y+, rr store indirect and post-increment (y) y rr, y + 1 none 1 (1) st -y, rr store indirect and pre-decrement y (y) y - 1, rr none 2 (1) std y+q, rr store indirect with displacement (y + q) rr none 2 (1) st z, rr store indirect (z) rr none 1 (1) st z+, rr store indirect and post-increment (z) z rr z + 1 none 1 (1) st -z, rr store indirect and pre-decrement z z - 1 none 2 (1) std z+q,rr store indirect with displacement (z + q) rr none 2 (1) lpm load program memory r0 (z) none 3 lpm rd, z load program memory rd (z) none 3 lpm rd, z+ load program memory and post-increment rd z (z), z + 1 none 3 elpm extended load program memory r0 (rampz:z) none 3 elpm rd, z extended load program memory rd (rampz:z) none 3 elpm rd, z+ extended load program memory and post- increment rd z (rampz:z), z + 1 none 3 spm store program memory (rampz:z) r1:r0 none - spm z+ store program memory and post-increment by 2 (rampz:z) z r1:r0, z + 2 none - in rd, a in from i/o location rd i/o(a) none 1 out a, rr out to i/o location i/o(a) rr none 1 push rr push register on stack stack rr none 1 (1) pop rd pop register from stack rd stack none 2 (1) bit and bit-test instructions lsl rd logical shift left rd(n+1) rd(0) c rd(n), 0, rd(7) z,c,n,v,h 1 lsr rd logical shift right rd(n) rd(7) c rd(n+1), 0, rd(0) z,c,n,v 1 mnemonics operands description operation flags #clocks
60 8135l?avr?06/12 xmega d4 notes: 1. cycle times for data memory accesses assume internal memo ry accesses, and are not valid for accesses via the external r am interface. 2. one extra cycle must be added when accessing internal sram. rol rd rotate left through carry rd(0) rd(n+1) c c, rd(n), rd(7) z,c,n,v,h 1 ror rd rotate right through carry rd(7) rd(n) c c, rd(n+1), rd(0) z,c,n,v 1 asr rd arithmetic shift right rd(n) rd(n+1), n=0..6 z,c,n,v 1 swap rd swap nibbles rd(3..0) ? rd(7..4) none 1 bset s flag set sreg(s) 1sreg(s)1 bclr s flag clear sreg(s) 0sreg(s)1 sbi a, b set bit in i/o register i/o(a, b) 1 none 1 cbi a, b clear bit in i/o register i/o(a, b) 0 none 1 bst rr, b bit store from register to t t rr(b) t 1 bld rd, b bit load from t to register rd(b) t none 1 sec set carry c 1c1 clc clear carry c 0c1 sen set negative flag n 1n1 cln clear negative flag n 0n1 sez set zero flag z 1z1 clz clear zero flag z 0z1 sei global interrupt enable i 1i1 cli global interrupt disable i 0i1 ses set signed test flag s 1s1 cls clear signed test flag s 0s1 sev set two?s complement overflow v 1v1 clv clear two?s complement overflow v 0v1 set set t in sreg t 1t1 clt clear t in sreg t 0t1 seh set half carry flag in sreg h 1h1 clh clear half carry flag in sreg h 0h1 mcu control instructions break break (see specific descr. for break) none 1 nop no operation none 1 sleep sleep (see specific descr. for sleep) none 1 wdr watchdog reset (see specific descr. for wdr) none 1 mnemonics operands description operation flags #clocks
61 8135l?avr?06/12 xmega d4 31. packaging information 31.1 44a 2325 orchard parkway san jose, ca 95131 title drawing no. r rev. 44a, 44-lead, 10 x 10mm body size, 1.0mm body thickness, 0.8 mm lead pitch, thin profile plastic quad flat package (tqfp) c 44a 2010-10-20 pin 1 identifier 0~7 pin 1 l c a1 a2 a d1 d e e1 e b common dimen s ion s (unit of measure = mm) s ymbol min nom max note notes: 1. this package conforms to jedec reference ms-026, variation acb. 2. dimensions d1 and e1 do not include mold protrusion. allowable protrusion is 0.25mm per side. dimensions d1 and e1 are maximum plastic body size dimensions including mold mismatch. 3. lead coplanarity is 0.10mm maximum. a ? ? 1.20 a1 0.05 ? 0.15 a2 0.95 1.00 1.05 d 11.75 12.00 12.25 d1 9.90 10.00 10.10 note 2 e 11.75 12.00 12.25 e1 9.90 10.00 10.10 note 2 b 0.30 ? 0.45 c 0.09 ? 0.20 l 0.45 ? 0.75 e 0.80 typ
62 8135l?avr?06/12 xmega d4 31.2 44m1 title drawing no. gpc rev. packa g e drawin g contact: packagedrawings@atmel.com 44m1 zws h 44m1, 44-pad, 7 x 7 x 1.0mm body, lead pitch 0.50mm, 5.20mm exposed pad, thermally enhanced plastic very thin quad flat no lead package (vqfn) 9/26/08 common dimen s ion s (unit of measure = mm) s ymbol min nom max note a 0.80 0.90 1.00 a1 ? 0.02 0.05 a3 0.20 ref b 0.18 0.23 0.30 d d2 5.00 5.20 5.40 6.90 7.00 7.10 6.90 7.00 7.10 e e2 5.00 5.20 5.40 e 0.50 bsc l 0.59 0.64 0.69 k 0.20 0.26 0.41 note: jedec standard mo-220, fig. 1 (saw singulation) vkkd-3. top view s ide view bottom view d e marked pin# 1 id e2 d2 b e pin #1 corner l a1 a3 a seating plane pin #1 triangle pin #1 chamfer (c 0.30) option a option b pin #1 notch (0.20 r) option c k k 1 2 3
63 8135l?avr?06/12 xmega d4 31.3 49c2 title drawing no. gpc rev. packa g e drawin g contact: packagedrawings@atmel.com 49c2 cbd a 49c2, 49-ball (7 x 7 array), 0.65mm pitch, 5.0 x 5.0 x 1.0mm, very thin, fine-pitch ball grid array package (vfbga) 3/14/08 common dimen s ion s (unit of measure = mm) s ymbol min nom max note a ? ? 1.00 a1 0.20 ? ? a2 0.65 ? ? d 4.90 5.00 5.10 d1 3.90 bsc e 4.90 5.00 5.10 e1 3.90 bsc b 0.30 0.35 0.40 e 0.65 bsc top view s ide view a1 ball id g f e d c b a 1 2 3 4 5 6 7 a a1 a2 d e 0.10 e1 d1 49 - ? 0.35 0.05 e a1 ball corner bottom view b e
64 8135l?avr?06/12 xmega d4 32. electrical characteristics all typical values are measured at t = 25 c unless other temperature condition is given. all min- imum and maximum values are valid across operating temperature and voltage unless other conditions are given. 32.1 absolute maximum ratings stresses beyond those listed in table 32-1 under may cause permanent damage to the device. this is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. exposure to absolute maximum rating co nditions for extend ed periods may affect device reliability. 32.2 general operating ratings the device must operate within the ratings listed in table 32-2 in order for all other electrical characteristics and typical characteristics of the device to be valid. table 32-1. absolute maximum ratings. symbol parameter condition min. typ. max. units v cc power supply voltage -0.3 4 v i vcc current into a v cc pin 200 ma i gnd current out of a gnd pin 200 v pin pin voltage with respect to gnd and v cc -0.5 v cc +0.5 v i pin i/o pin sink/source current -25 25 ma t a storage temperature -65 150 c t j junction temperature 150 table 32-2. general operating conditions. symbol parameter condition min. typ. max. units v cc power supply voltage 1.60 3.6 v av cc analog supply voltage 1.60 3.6 t a temperature range -40 85 c t j junction temperature -40 105
65 8135l?avr?06/12 xmega d4 the maximum cpu clock frequency depends on v cc . as shown in figure 32-1 the frequency vs. v cc curve is linear between 1.8v < v cc <2.7v. figure 32-1. maximum frequency vs. v cc . table 32-3. operating voltage and frequency. symbol parameter conditi on min. typ. max. units clk cpu cpu clock frequency v cc = 1.6v 0 12 mhz v cc = 1.8v 0 12 v cc = 2.7v 0 32 v cc = 3.6v 0 32 1. 8 12 32 mhz v 2.7 3.6 1.6 safe operating area
66 8135l?avr?06/12 xmega d4 32.3 current consumption notes: 1. all power reduction registers set. 2. maximum limits are based on characterization, and not tested in production. table 32-4. current consumption for active mode and sleep modes. symbol parameter condition min. typ. max. units i cc active power consumption (1) 32khz, ext. clk. v cc = 1.8v 68 a v cc = 3.0v 145 1mhz, ext. clk. v cc = 1.8v 260 v cc = 3.0v 540 2mhz, ext. clk. v cc = 1.8v 460 600 v cc = 3.0v 0.96 1.4 ma 32mhz, ext. clk. 9.8 12 idle power consumption (1) 32khz, ext. clk. v cc = 1.8v 2.4 a v cc = 3.0v 3.9 1mhz, ext. clk. v cc = 1.8v 62 v cc = 3.0v 118 2mhz, ext. clk. v cc = 1.8v 125 225 v cc = 3.0v 240 350 32mhz, ext. clk. 3.8 5.5 ma power-down power consumption t=25c v cc = 3.0v 0.1 1.0 a t = 85c 1.2 4.5 wdt and sampled bod enabled, t=25c v cc = 3.0v 1.3 3.0 wdt and sampled bod enabled, t = 85c 2.4 6.0 power-save power consumption (2) rtc from ulp clock, wdt and sampled bod enabled, t = 25c v cc = 1.8v 1.2 v cc = 3.0v 1.3 rtc from 1.024khz low power 32.768khz tosc, t = 25c v cc = 1.8v 0.6 2 v cc = 3.0v 0.7 2 rtc from low power 32.768khz tosc, t = 25c v cc = 1.8v 0.8 3 v cc = 3.0v 1.0 3 reset power consumption current through reset pin substracted v cc = 3.0v 320
67 8135l?avr?06/12 xmega d4 note: 1. all parameters measured as the difference in curren t consumption between module enabled and disabled. all data at v cc =3.0v, clk sys = 1mhz external clock without prescaling, t = 25c unless other conditions are given. table 32-5. current consumption for modules and peripherals. symbol parameter condition (1) min. typ. max. units i cc ulp oscillator 1.0 a 32.768khz int. oscillator 27 2mhz int. oscillator 85 dfll enabled with 32.768khz int. osc. as reference 115 32mhz int. oscillator 270 dfll enabled with 32.768khz int. osc. as reference 460 pll 20x multiplication factor, 32mhz int. osc. div4 as reference 220 watchdog timer 1 bod continuous mode 138 sampled mode, includes ulp oscillator 1.2 internal 1.0v reference 100 temperature sensor 95 adc 50ksps v ref = ext ref 3.0 ma currlimit = low 2.6 currlimit = medium 2.1 currlimit = high 1.6 ac 330 a timer/counter 16 usart rx and tx enabled, 9600 baud 2.5 flash memory and eeprom programming 4 8 ma
68 8135l?avr?06/12 xmega d4 32.4 wake-up time from sleep modes note: 1. the wake-up time is the time from the wake-up request is given until the peripheral clock is available on pin, see figure 32- 2 . all peripherals and modules st art execution from the first cl ock cycle, expect the cpu that is halted for four clock cycles before program execution starts. figure 32-2. wake-up time definition. table 32-6. device wake-up time from sleep modes with various syst em clock sources. symbol parameter condition min. typ. (1) max. units t wakeup wake-up time from idle, standby, and extended standby mode external 2mhz clock 2 s 32.768khz internal oscillator 120 2mhz internal oscillator 2 32mhz internal oscillator 0.2 wake-up time from power-save and power-down mode external 2mhz clock 4.5 32.768khz internal oscillator 320 2mhz internal oscillator 9 32mhz internal oscillator 5 wakeup request clock output wakeup time
69 8135l?avr?06/12 xmega d4 32.5 i/o pin c haracteristics the i/o pins complies with the jedec lvttl an d lvcmos specification and the high- and low level input and output voltage limits reflect or exceed this specification. notes: 1. the sum of all i oh for porta and portb must not exceed 100ma. the sum of all i oh for portc must not exceed 200ma. the sum of all i oh for portd and pins pe[0-1] on porte must not exceed 200ma. the sum of all i oh for pe[2-3] on porte, portr and pdi must not exceed 100ma. 2. the sum of all i ol for porta and portb must not exceed 100ma. the sum of all i ol for portc must not not exceed 200ma. the sum of all i ol for portd and pins pe[0-1] on porte must not exceed 200ma. the sum of all i ol for pe[2-3] on porte, portr and pdi must not exceed 100ma. table 32-7. i/o pin characteristics. symbol parameter conditi on min. typ. max. units i oh (1) / i ol (2) i/o pin source/sink current -15 15 ma v ih high level input voltage v cc = 2.7 - 3.6v 2 v cc +0.3 v v cc = 2.0 - 2.7v 0.7v cc v cc +0.3 v cc = 1.6 - 2.0v 0.7v cc v cc +0.3 v il low level input voltage v cc = 2.7- 3.6v -0.3 0.3v cc v cc = 2.0 - 2.7v -0.3 0.3v cc v cc = 1.6 - 2.0v -0.3 0.3v cc v oh high level output voltage v cc = 3.3v i oh = -4ma 2.6 2.9 v cc = 3.0v i oh = -3ma 2.1 2.6 v cc = 1.8v i oh = -1ma 1.4 1.6 v ol low level output voltage v cc = 3.3v i ol = 8ma 0.4 0.76 v cc = 3.0v i ol = 5ma 0.3 0.64 v cc = 1.8v i ol = 3ma 0.2 0.46 i in input leakage current t = 25c <0.001 0.1 a r p pull/buss keeper resistor 24 k t r rise time no load 4 ns slew rate limitation 7
70 8135l?avr?06/12 xmega d4 32.6 adc characteristics table 32-8. power supply, reference and input range. symbol parameter condition min. typ. max. units av cc analog supply voltage v cc - 0.3 v cc + 0.3 v v ref reference voltage 1 av cc - 0.6 r in input resistance switched 4.0 k c sample input capacitance switched 4.4 pf r aref reference input resistance (leakage only) >10 m c aref reference input capacit ance static load 7 pf v in input range -0.1 av cc + 0.1 v conversion range differential mode, vinp - vinn -v ref v ref v in conversion range single ended unsigned mode, vinp - v v ref - v v fixed offset voltage 190 lsb table 32-9. clock and timing. symbol parameter condition min. typ. max. units clk adc adc clock frequency maximum is 1/4 of peripheral clock frequency 100 1400 khz measuring internal signals 100 125 f adc sample rate current limitation ( currlimit) off 14 200 ksps currlimit = low 14 150 currlimit = medium 14 100 currlimit = high 14 50 sampling time 1/2 clk adc cycle 0.25 5 s conversion time (latency) (res+2)/2+gain res = 8 or 12, gain = 0, 1, 2, or 3 5710 clk adc cycles start-up time adc clock cycles 12 24 clk adc cycles adc settling time after changing reference or input mode 7 7 after adc flush 1 1 table 32-10. accuracy characteristics. symbol parameter condition (2) min. typ. max. units res resolution programmable to 8 or 12 bit 8 12 12 bits inl (1) integral non-linearity 50ksps v cc -1.0v < v ref < v cc -0.6v 1.2 3 lsb all v ref 1.5 4 200ksps v cc -1.0v < v ref < v cc -0.6v 1.0 3 all v ref 1.5 4 dnl (1) differential non-linearity guaranteed monotonic <0.8 <1
71 8135l?avr?06/12 xmega d4 notes: 1. maximum numbers are based on characterisation and not te sted in production, and valid for 5% to 95% input voltage range . 2. unless otherwise noted all linearity, offset and gain erro r numbers are valid under the condition that external v ref is used. note: 1. maximum numbers are based on characterisation and not te sted in production, and valid for 5% to 95% input voltage range. offset error -1 mv temperature drift <0.01 mv/k operating voltage drift <0.6 mv/v gain error differential mode external reference -1 mv av cc /1.6 10 av cc /2.0 8 bandgap 5 temperature drift <0.02 mv/k operating voltage drift <0.5 mv/v noise differential mode, shorted input 200ksps, v cc = 3.6v, clk per = 16mhz 0.4 mv rms table 32-10. accuracy characteristics. (continued) symbol parameter condition (2) min. typ. max. units table 32-11. gain stage characteristics. symbol parameter condition min. typ. max. units r in input resistance switched in normal mode 4.0 k c sample input capacitance switched in normal mode 4.4 pf signal range gain stage output 0 v cc - 0.6 v propagation delay adc conversion rate 1 clk adc cycles sample rate same as adc 14 200 khz inl (1) integral non-linearity 50ksps all gain settings 1.5 4 lsb gain error 1x gain, normal mode -0.8 % 8x gain, normal mode -2.5 64x gain, normal mode -3.5 offset error, input referred 1x gain, normal mode -2 mv 8x gain, normal mode -5 64x gain, normal mode -4 noise 1x gain, normal mode v cc = 3.6v ext. v ref 0.5 mv rms 8x gain, normal mode 1.5 64x gain, normal mode 11
72 8135l?avr?06/12 xmega d4 32.7 analog comparator characteristics 32.8 bandgap and internal 1.0v reference characteristics table 32-12. analog comparator characteristics. symbol parameter condition min. typ. max. units v off input offset voltage <10 mv i lk input leakage current <1 na input voltage range -0.1 av cc v ac startup time 100 s v hys1 hysteresis, none 0mv v hys2 hysteresis, small 13 v hys3 hysteresis, large 30 t delay propagation delay v cc = 3.0v, t= 85c 30 90 ns 30 64-level voltage scaler integral non-linearity (inl) 0.3 0.5 lsb table 32-13. bandgap and internal 1.0v reference characteristics. symbol parameter condition min. typ. max. units startup time as reference for adc 1 clk per + 2.5s s as input voltage to adc and ac 1.5 bandgap voltage 1.1 v int1v internal 1.00v reference t= 85c, after calibration 0.99 1 1.01 variation over voltage and temperature relative to t= 85c, v cc = 3.0v 1.5 %
73 8135l?avr?06/12 xmega d4 32.9 brownout detection characteristics 32.10 external reset characteristics 32.11 power-on reset characteristics note: 1. v pot- values are only valid when bod is disabled. when bod is enabled v pot- = v pot+ . table 32-14. brownout detection characteristics. symbol parameter condition min. typ. max. units v bot bod level 0 falling v cc 1.60 1.62 1.72 v bod level 1 falling v cc 1.8 bod level 2 falling v cc 2.0 bod level 3 falling v cc 2.2 bod level 4 falling v cc 2.4 bod level 5 falling v cc 2.6 bod level 6 falling v cc 2.8 bod level 7 falling v cc 3.0 t bod detection time continuous mode 0.4 s sampled mode 1000 v hyst hysteresis 1.2 % table 32-15. external reset characteristics. symbol parameter condition min. typ. max. units t ext minimum reset pulse width 95 1000 ns v rst reset threshold voltage (v ih ) v cc = 2.7 - 3.6v 0.60v cc v v cc = 1.6 - 2.7v 0.60v cc reset threshold voltage (v il ) v cc = 2.7 - 3.6v 0.50v cc v cc = 1.6 - 2.7v 0.40v cc r rst reset pin pull-up resistor 25 k table 32-16. power-on reset characteristics. symbol parameter condition min. typ. max. units v pot- (1) por threshold voltage falling v cc v cc falls faster than 1v/ms 0.4 1.0 v v cc falls at 1v/ms or slower 0.8 1.0 v pot+ por threshold voltage rising v cc 1.3 1.59
74 8135l?avr?06/12 xmega d4 32.12 flash and eeprom memory characteristics notes: 1. programming is timed from the 2mhz internal oscillator. 2. eeprom is not erased if the eesave fuse is programmed. table 32-17. endurance and data retention. symbol parameter condition min. typ. max. units flash write/erase cycles 25c 10k cycle 85c 10k data retention 25c 100 ye a r 55c 25 eeprom write/erase cycles 25c 80k cycle 85c 30k data retention 25c 100 ye a r 55c 25 table 32-18. programming time. symbol parameter condition min. typ. (1) max. units chip erase 128kb flash, eeprom (2) and sram erase 75 ms 64kb flash, eeprom (2) and sram erase 55 32kb flash, eeprom (2) and sram erase 50 16kb flash, eeprom (2) and sram erase 45 flash page erase 4 page write 4 atomic page erase and write 8 eeprom page erase 4 page write 4 atomic page erase and write 8
75 8135l?avr?06/12 xmega d4 32.13 clock and oscillator characteristics 32.13.1 calibrated 32.768khz internal oscillator characteristics 32.13.2 calibrated 2mhz rc internal oscillator characteristics 32.13.3 calibrated and tunable 32mhz internal oscillator characteristics 32.13.4 32khz internal ulp oscillator characteristics table 32-19. 32.768khz internal osc illator characteristics. symbol parameter condition min. typ. max. units frequency 32.768 khz factory calibration accuracy t = 85 c, v cc = 3.0v -0.5 0.5 % user calibration accuracy -0.5 0.5 table 32-20. 2mhz internal oscillator characteristics. symbol parameter condition min. typ. max. units frequency range dfll can tune to this frequency over voltage and temperature 1.8 2.2 mhz factory calibrated frequency 2.0 factory calibration accuracy t = 85 c, v cc = 3.0v -1.5 1.5 % user calibration accuracy -0.2 0.2 dfll calibration stepsize 0.21 table 32-21. 32mhz internal oscillator characteristics. symbol parameter condition min. typ. max. units frequency range dfll can tune to this frequency over voltage and temperature 30 55 mhz factory calibrated frequency 32 factory calibration accuracy t = 85 c, v cc = 3.0v -1.5 1.5 % user calibration accuracy -0.2 0.2 dfll calibration step size 0.22 table 32-22. 32khz internal ulp osc illator charac teristics. symbol parameter condition min. typ. max. units output frequency 32 khz accuracy -30 30 %
76 8135l?avr?06/12 xmega d4 32.13.5 internal phase locked loop (pll) characteristics note: 1. the maximum output frequency vs. supply voltage is linear between 1.8v and 2.7v, and can never be higher than four times the maximum cpu frequency. 32.13.6 external clock characteristics figure 32-3. external clock drive waveform. note: 1. the maximum frequency vs. supply voltage is linear between 1. 8v and 2.7v, and the same applies for all other parameters with supply voltage conditions. table 32-23. internal pll characteristics. symbo l parameter condition min. typ. max. units f in input frequency output fr equency must be within f out 0.4 64 mhz f out output frequency (1) v cc = 1.6 - 1.8v 20 48 v cc = 2.7 - 3.6v 20 128 start-up time 25 s re-lock time 25 t ch t cl t ck t ch v il1 v ih1 t cr t cf table 32-24. external clock used as system clock without prescaling. symbo l parameter condition min. typ. max. units 1/t ck clock frequency (1) v cc = 1.6 - 1.8v 0 12 mhz v cc = 2.7 - 3.6v 0 32 t ck clock period v cc = 1.6 - 1.8v 83.3 ns v cc = 2.7 - 3.6v 31.5 t ch clock high time v cc = 1.6 - 1.8v 30.0 v cc = 2.7 - 3.6v 12.5 t cl clock low time v cc = 1.6 - 1.8v 30.0 v cc = 2.7 - 3.6v 12.5 t cr rise time (for maximum frequency) v cc = 1.6 - 1.8v 10 v cc = 2.7 - 3.6v 3 t cf fall time (for maximum frequency) v cc = 1.6 - 1.8v 10 v cc = 2.7 - 3.6v 3 t ck change in period from one clock cycle to the next 10 %
77 8135l?avr?06/12 xmega d4 . notes: 1. system clock prescalers must be set so that maximum cpu clock frequency for device is not exceeded. 2. the maximum frequency vs. supply voltage is linear between 1.8v and 2.7v, and the same applies for all other parameters with supply voltage conditions. table 32-25. external clock with prescaler (1) for system clock. symbol parameter condition min. typ. max. units 1/t ck clock frequency (2) v cc = 1.6 - 1.8v 0 90 mhz v cc = 2.7 - 3.6v 0 142 t ck clock period v cc = 1.6 - 1.8v 11 ns v cc = 2.7 - 3.6v 7 t ch clock high time v cc = 1.6 - 1.8v 4.5 v cc = 2.7 - 3.6v 2.4 t cl clock low time v cc = 1.6 - 1.8v 4.5 v cc = 2.7 - 3.6v 2.4 t cr rise time (for maximum frequency) 1.5 t cf fall time (for maximum frequency) 1.5 t ck change in period from one clock cycle to the next 10 %
78 8135l?avr?06/12 xmega d4 32.13.7 external 16mhz crystal oscillator and xosc characteristics table 32-26. external 16mhz crystal oscilla tor and xosc characteristics. symbol parameter condition min. typ. max. units cycle to cycle jitter xoscpwr=0 frqrange=0 <10 ns frqrange=1, 2, or 3 <1 xoscpwr=1 <1 long term jitter xoscpwr=0 frqrange=0 <6 frqrange=1, 2, or 3 <0.5 xoscpwr=1 <0.5 frequency error xoscpwr=0 frqrange=0 <0.1 % frqrange=1 <0.05 frqrange=2 or 3 <0.005 xoscpwr=1 <0.005 duty cycle xoscpwr=0 frqrange=0 40 frqrange=1 42 frqrange=2 or 3 45 xoscpwr=1 48
79 8135l?avr?06/12 xmega d4 note: 1. numbers for negative impedance are not tested in production but guaranteed from design and characterization. r q negative impedance (1) xoscpwr=0, frqrange=0 0.4mhz resonator, cl = 100pf 2.4k 1mhz crystal, cl = 20pf 8.7k 2mhz crystal, cl = 20pf 2.1k xoscpwr=0, frqrange=1, cl=20pf 2mhz crystal 4.2k 8mhz crystal 250 9mhz crystal 195 xoscpwr=0, frqrange=2, cl=20pf 8mhz crystal 360 9mhz crystal 285 12mhz crystal 155 xoscpwr=0, frqrange=3, cl=20pf 9mhz crystal 365 12mhz crystal 200 16mhz crystal 105 xoscpwr=1, frqrange=0, cl=20pf 9mhz crystal 435 12mhz crystal 235 16mhz crystal 125 xoscpwr=1, frqrange=1, cl=20pf 9mhz crystal 495 12mhz crystal 270 16mhz crystal 145 xoscpwr=1, frqrange=2, cl=20pf 12mhz crystal 305 16mhz crystal 160 xoscpwr=1, frqrange=3, cl=20pf 12mhz crystal 380 16mhz crystal 205 c xtal1 parasitic capacitance xtal1 pin 5.4 pf c xtal2 parasitic capacitance xtal2 pin 7.1 c load parasitic capacitance load 3.07 table 32-26. external 16mhz crystal oscillator an d xosc characteri stics. (continued) symbol parameter condition min. typ. max. units
80 8135l?avr?06/12 xmega d4 32.13.8 external 32.768khz crystal oscillator and tosc characteristics note: 1. see figure 32-4 for definition. figure 32-4. tosc input capacitance. the parasitic capacitance between the tosc pins is c l1 + c l2 in series as seen from the crystal when oscillating without external capacitors. table 32-27. external 32.768khz crystal osc illator and tosc characteristics. symbol parameter condition min. typ. max. units esr/r1 recommended crystal equivalent series resistance (esr) crystal load capacitance 6.5pf 60 k crystal load capacitance 9.0pf 35 c tosc1 parasitic capacitance tosc1 pin 5.4 pf alternate tosc 4.0 c tosc2 parasitic capacitance tosc2 pin 7.1 pf alternate tosc 4.0 recommended safety factor capacitance load matched to crystal specification 3 c l1 c l2 2 c s o t 1 c s o t device internal external 32.768khz crystal
81 8135l?avr?06/12 xmega d4 32.14 spi characteristics figure 32-5. spi timing requirements in master mode. figure 32-6. spi timing requirements in slave mode. msb lsb msb lsb t mos t mis t mih t sckw t sck t moh t moh t sckf t sckr t sckw mo si (data output) mi so (data input) sck (cpol = 1) sck (cpol = 0) ss msb lsb msb lsb t sis t sih t ssckw t ssckw t ssck t ssh t sossh t sckr t sckf t sos t sss t sosss mi so (data output) mo si (data input) sck (cpol = 1) sck (cpol = 0) ss
82 8135l?avr?06/12 xmega d4 table 32-28. spi timing characteristics and requirements. symbol parameter condition min. typ. max. units t sck sck period master (see table 17-4 in xmega d manual ) ns t sckw sck high/low width master 0.5sck t sckr sck rise time master 2.7 t sckf sck fall time master 2.7 t mis miso setup to sck master 10 t mih miso hold after sck master 10 t mos mosi setup sck master 0.5sck t moh mosi hold after sck master 1 t ssck slave sck period slave 4t clk per t ssckw sck high/low width slave 2t clk per t ssckr sck rise time slave 1600 t ssckf sck fall time slave 1600 t sis mosi setup to sck slave 3 t sih mosi hold after sck slave t clk per t sss ss setup to sck slave 21 t ssh ss hold after sck slave 20 t sos miso setup sck slave 8 t soh miso hold after sck slave 13 t soss miso setup after ss low slave 11 t sosh miso hold after ss high slave 8
83 8135l?avr?06/12 xmega d4 32.15 two-wire interface characteristics table 32-29 describes the requirements for devices connected to the two-wire interface bus. the atmel avr xmega two-wire interface meets or exceeds these requirements under the noted conditions. timing symbols refer to figure 32-7 . figure 32-7. two-wire interface bus timing. t hd;sta t of sda scl t low t high t su;sta t buf t r t hd;dat t su;dat t su;sto table 32-29. two-wire interface characteristics. symbol parameter condition min. typ. max. units v ih input high voltage 0.7v cc v cc +0.5 v v il input low voltage 0.5 0.3v cc v hys hysteresis of schmitt trigger inputs 0.05v cc (1) v ol output low voltage 3ma, sink current 0 0.4 t r rise time for both sda and scl 20+0.1c b (1)(2) 300 ns t of output fall time from v ihmin to v ilmax 10pf < c b < 400pf (2) 20+0.1c b (1)(2) 250 t sp spikes suppressed by input filter 0 50 i i input current for each i/o pin 0.1v cc < v i < 0.9v cc -10 10 a c i capacitance for each i/o pin 10 pf f scl scl clock frequency f per (3) >max(10f scl , 250khz) 0 400 khz r p value of pull-up resistor f scl 100khz f scl > 100khz v cc 0.4 v ? 3 ma ---------------------------- 100 ns c b --------------- - 300 ns c b --------------- -
84 8135l?avr?06/12 xmega d4 notes: 1. required only for f scl > 100khz. 2. c b = capacitance of one bus line in pf. 3. f per = peripheral clock frequency. t hd;sta hold time (repeated) start condition f scl 100khz 4.0 s f scl > 100khz 0.6 t low low period of scl clock f scl 100khz 4.7 f scl > 100khz 1.3 t high high period of scl clock f scl 100khz 4.0 f scl > 100khz 0.6 t su;sta set-up time for a repeated start condition f scl 100khz 4.7 f scl > 100khz 0.6 t hd;dat data hold time f scl 100khz 0 3.45 s f scl > 100khz 0 0.9 t su;dat data setup time f scl 100khz 250 f scl > 100khz 100 t su;sto setup time for stop condition f scl 100khz 4.0 f scl > 100khz 0.6 t buf bus free time between a stop and start condition f scl 100khz 4.7 f scl > 100khz 1.3 table 32-29. two-wire interface characteristics. (continued) symbol parameter condition min. typ. max. units
85 8135l?avr?06/12 xmega d4 33. typical characteristics 33.1 current consumption 33.1.1 active mode supply current figure 33-1. active supply current vs. frequency. f sys = 0 - 1mhz external clock, t = 25c . figure 33-2. active supply current vs. frequency. f sys = 1 - 32mhz external clock, t = 25c . 3.3v 3.0v 2.7v 2.2v 1.8v 0 100 200 300 400 500 600 700 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 frequency [mhz] i cc [a] 3.3v 3.0v 2.7v 0 2 4 6 8 10 12 048121620242832 frequency [mhz] i cc [ma] 2.2v 1.8v
86 8135l?avr?06/12 xmega d4 figure 33-3. active mode supply current vs. v cc . f sys = 32.768khz inter nal oscillator . figure 33-4. active mode supply current vs. v cc . f sys = 1mhz external clock . 85c 25c -40c 60 90 120 150 180 210 240 270 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a] 85c 25c -40c 200 300 400 500 600 700 800 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a]
87 8135l?avr?06/12 xmega d4 figure 33-5. active mode supply current vs. v cc . f sys = 2mhz internal oscillator . figure 33-6. active mode supply current vs. v cc . f sys = 32mhz internal oscillat or prescaled to 8mhz. 85c 25c -40c 400 600 800 1000 1200 1400 1600 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a] 85c 25c -40c 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [ma]
88 8135l?avr?06/12 xmega d4 figure 33-7. active mode supply current vs. v cc . f sys = 32mhz internal oscillator. 33.1.2 idle mode supply current figure 33-8. idle mode supply current vs. frequency. f sys = 0 - 1mhz external clock, t = 25c . 85c 25c -40c 8 9 10 11 12 13 14 15 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 v cc [v] i cc [ma] 3.3v 3.0v 2.7v 2.2v 1.8v 0 20 40 60 80 100 120 140 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 frequency [mhz] i cc [a]
89 8135l?avr?06/12 xmega d4 figure 33-9. idle mode supply current vs. frequency. f sys = 1 - 32mhz external clock, t = 25c . figure 33-10. idle mode supply current vs. v cc . f sys = 32.768khz inter nal oscillator . 3.3v 3.0v 2.7v 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 048121620242832 frequency [mhz] i cc [ma] 2.2v 1.8v 85c 25c -40c 27.0 27.5 28.0 28.5 29.0 29.5 30.0 30.5 31.0 31.5 32.0 32.5 33.0 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a]
90 8135l?avr?06/12 xmega d4 figure 33-11. idle mode supply current vs. v cc . f sys = 1mhz external clock . figure 33-12. idle mode supply current vs. v cc . f sys = 2mhz internal oscillator . 85c 25c -40c 50 60 70 80 90 100 110 120 130 140 150 160 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a] 85c 25c -40c 160 180 200 220 240 260 280 300 320 340 360 380 400 420 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a]
91 8135l?avr?06/12 xmega d4 figure 33-13. idle mode supply current vs. v cc . f sys = 32mhz internal oscill ator prescaled to 8mhz . figure 33-14. idle mode current vs. v cc . f sys = 32mhz internal oscillator . 85c 25c -40c 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [ma] 85c 25c -40c 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 v cc [v] i cc [ma]
92 8135l?avr?06/12 xmega d4 33.1.3 power-down mode supply current figure 33-15. power-down mode supply current vs. temperature. all functions disabled . figure 33-16. power-down mode supp ly current vs. v cc . all functions disabled . 3.3v 3.0v 2.7v 2.2v 1.8v 0 0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 temperature [c] i cc [a] 85c 25c -40c 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a]
93 8135l?avr?06/12 xmega d4 figure 33-17. power-down mode supp ly current vs. v cc . watchdog and sampled bod enabled . 33.1.4 power-save mode supply current figure 33-18. power-save mode supply current vs. v cc . real time counter enabled and running from 1.024khz output of 32.768khz tosc . 85c 25c -40c 1.1 1.3 1.5 1.7 1.9 2.1 2.3 2.5 2.7 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a] normal mode low-power mode 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 v cc [v] i cc [a] 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6
94 8135l?avr?06/12 xmega d4 33.1.5 standby mode supply current figure 33-19. standby supply current vs. v cc . standby, f sys =1mhz . figure 33-20. standby supply current vs. v cc . 25c, running from diffe rent crystal oscillators . 85c 25c -40c 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a] 16mhz 12mhz 8mhz 2mhz 0.454mhz 160 200 240 280 320 360 400 440 480 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] i cc [a]
95 8135l?avr?06/12 xmega d4 33.2 i/o pin c haracteristics 33.2.1 pull-up figure 33-21. i/o pin pull-up resistor current vs. input voltage. v cc = 1.8v . figure 33-22. i/o pin pull-up resistor current vs. input voltage. v cc = 3.0v . 85c 25c -40c 0 10 20 30 40 50 60 70 0.10.30.50.70.91.11.31.51.7 v pin [v] i [a] 85c 25c -40c 0 15 30 45 60 75 90 105 120 0.1 0.4 0.7 1.0 1.3 1.6 1.9 2.2 2.5 2.8 3.1 v pin [v] i [a]
96 8135l?avr?06/12 xmega d4 figure 33-23. i/o pin pull-up resistor current vs. input voltage. v cc = 3.3v . 33.2.2 output voltage vs. sink/source current figure 33-24. i/o pin output voltage vs. source current. v cc = 1.8v . 85c 25c -40c 0 15 30 45 60 75 90 105 120 135 0.1 0.4 0.7 1.0 1.3 1.6 1.9 2.2 2.5 2.8 3.1 3.4 v pin [v] i [a] 85c 25c -40c 0.5 0.7 0.9 1.1 1.3 1.5 1.7 1.9 i pin [ma] v pin [v] -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0
97 8135l?avr?06/12 xmega d4 figure 33-25. i/o pin output voltage vs. source current. v cc = 3.0v . figure 33-26. i/o pin output voltage vs. source current. v cc = 3.3v . 85c 25c -40c 0.5 1.0 1.5 2.0 2.5 3.0 i pin [ma] v pin [v] -15.0 -12.5 -10.0 -7.5 -5.0 -2.5 0 85c 25c -40c 0.5 1.0 1.5 2.0 2.5 3.0 3.5 i pin [ma] v pin [v] -15.0 -12.5 -10.0 -7.5 -5.0 -2.5 0
98 8135l?avr?06/12 xmega d4 figure 33-27. i/o pin output voltage vs. source current. figure 33-28. i/o pin output voltage vs. sink current. v cc = 1.8v . 3.6v 3.3v 3.0v 2.7v 2.3v 1.8v 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 i pin [ma] v pin [v] -12.0 -10.5 -9.0 -6.0 -4.5 -1.5 0 -3.0 -7.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 i pin [ma] v pin [v] 85c 25c -40c 23467910 8 5 01
99 8135l?avr?06/12 xmega d4 figure 33-29. i/o pin output voltage vs. sink current. v cc = 3.0v . figure 33-30. i/o pin output voltage vs. sink current. v cc = 3.3v . 85c 25c -40c 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 i pin [ma] v pin [v] 3.0 4.5 6.0 9.0 10.5 13.5 15.0 12.0 7.5 0 1.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 i pin [ma] v pin [v] -40c 25c 85c 3.0 4.5 6.0 9.0 10.5 13.5 15.0 12.0 7.5 0 1.5
100 8135l?avr?06/12 xmega d4 figure 33-31. i/o pin output voltage vs. sink current. 33.2.3 thresholds and hysteresis figure 33-32. i/o pin input threshold voltage vs. v cc . t = 25c . 0 0.3 0.6 0.9 1.2 1.5 i pin [ma] v pin [v] 1.8v 3.6v 3.3v 3.0v 2.7v 2.3v 5.0 7.5 12.5 15.0 10.0 02.5 vil vih 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v threshold [v]
101 8135l?avr?06/12 xmega d4 figure 33-33. i/o pin input threshold voltage vs. v cc . v ih i/o pin read as ?1? . figure 33-34. i/o pin input threshold voltage vs. v cc . v il i/o pin read as ?0? . 85c 25c -40c 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v threshold [v] 85c 25c -40c 0.57 0.72 0.87 1.02 1.17 1.32 1.47 1.62 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v threshold [v]
102 8135l?avr?06/12 xmega d4 figure 33-35. i/o pin input hysteresis vs. v cc . 33.3 analog comparat or characteristics figure 33-36. analog comparator hysteresis vs. v cc . small hysteresis . 85c 25c -40c 0.09 0.12 0.15 0.18 0.21 0.24 0.27 0.3 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v threshold [v] 85c 25c -40c 7 8 9 10 11 12 13 14 15 16 17 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v hyst [mv]
103 8135l?avr?06/12 xmega d4 figure 33-37. analog comparator hysteresis vs. v cc . large hysteresis . figure 33-38. analog comparator current source vs. calibration value. temperature = 25c. 85c 25c -40c 20 22 24 26 28 30 32 34 36 38 40 1.61.82.0 2.22.42.62.83.03.23.43.6 v cc [v] v hyst [mv] 3.3 v 3.0 v 2.7 v 2.2 v 1. 8v 2 3 4 5 6 7 8 01234567 8 9 101112131415 calib[3..0] i [ a]
104 8135l?avr?06/12 xmega d4 figure 33-39. analog comparator current source vs. calibration value. v cc = 3.0v. figure 33-40. voltage scaler inl vs. scalefac. t = 25 c, v cc = 3.0v . 85c 25c -40c 3.5 4 4.5 5 5.5 6 6.5 7 0123456789101112131415 calib[3..0] i [a] 25c -0.150 -0.125 -0.100 -0.075 -0.050 -0.025 0 0.025 0.050 0 10203040506070 scalefac inl [lsb]
105 8135l?avr?06/12 xmega d4 33.4 internal 1.0v re ference characteristics figure 33-41. adc internal 1.0v reference vs. temperature. 33.5 bod characteristics figure 33-42. bod thresholds vs. temperature. bod level = 1.6v . 3.3v 3.0v 2.7v 1.8v 0.987 0.989 0.991 0.993 0.995 0.997 0.999 1.001 1.003 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 bandgap voltage [v] temperature [c] rising vcc falling vcc 1.603 1.606 1.609 1.612 1.615 1.618 1.621 1.624 1.627 1.630 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 temperature [c] v bot [v]
106 8135l?avr?06/12 xmega d4 figure 33-43. bod thresholds vs. temperature. bod level = 3.0v . 33.6 external reset characteristics figure 33-44. minimum reset pin pulse width vs. v cc . rising vcc falling vcc 2.97 2.98 2.99 3.00 3.01 3.02 3.03 3.04 3.05 3.06 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 temperature [c] v bot [v] 85c 25c -40c 80 85 90 95 100 105 110 115 120 125 130 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] t rst [ns]
107 8135l?avr?06/12 xmega d4 figure 33-45. reset pin pull-up resistor current vs. reset pin voltage. v cc = 1.8v . figure 33-46. reset pin pull-up resistor current vs. reset pin voltage. v cc = 3.0v . 85c 25c -40c 0 10 20 30 40 50 60 70 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 v reset [v] i reset [a] 85c 25c -40c 0 15 30 45 60 75 90 105 120 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 v reset [v] i reset [a]
108 8135l?avr?06/12 xmega d4 figure 33-47. reset pin pull-up resistor current vs. reset pin voltage. v cc = 3.3v . figure 33-48. reset pin input threshold voltage vs. v cc . v ih - reset pin read as ?1? . 85c 25c -40c 0 15 30 45 60 75 90 105 120 135 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 3.3 v reset [v] i reset [a] 85c 25c -40c 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v threshold [v]
109 8135l?avr?06/12 xmega d4 figure 33-49. reset pin input threshold voltage vs. v cc . v il - reset pin read as ?0? . 33.7 power-on reset characteristics figure 33-50. power-on reset current consumption vs. v cc . bod level = 3.0v, enabled in continuous mode . 85c 25c -40c 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 v cc [v] v threshold [v] 85c 25c -40c 0 100 200 300 400 500 600 700 0.4 0.7 1.0 1.3 1.6 1.9 2.2 2.5 2.8 v cc [v] i cc [a]
110 8135l?avr?06/12 xmega d4 figure 33-51. power-on reset current consumption vs. v cc . bod level = 3.0v, enabled in sampled mode . 33.8 oscillator characteristics 33.8.1 ultra low-power internal oscillator figure 33-52. ultra low-power internal oscilla tor frequency vs. temperature. 85c 25c -40c 0 65 130 195 260 325 390 455 520 585 650 0.40.71.01.31.61.92.22.52.8 v cc [v] i cc [a] 3.3v 3.0v 2.7v 2.2v 1.8v 30.5 30.7 30.9 31.1 31.3 31.5 31.7 31.9 32.1 32.3 32.5 32.7 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 frequency [khz] temperature [c]
111 8135l?avr?06/12 xmega d4 33.8.2 32.768khz internal oscillator figure 33-53. 32.768khz internal oscillato r frequency vs. temperature. figure 33-54. 32.768khz internal oscillator frequency vs. calibration value. v cc = 3.0v, t = 25c . 3.3v 3.0v 2.7v 2.2v 1.8v 32.59 32.61 32.63 32.65 32.67 32.69 32.71 32.73 32.75 32.77 32.79 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 frequency [khz] temperature [c] 22 25 28 31 34 37 40 43 46 49 52 0 24 48 72 96 120 144 168 192 216 240 264 rc32kcal[7..0] frequency [khz]
112 8135l?avr?06/12 xmega d4 33.8.3 2mhz internal oscillator figure 33-55. 2mhz internal oscillator frequency vs. temperature. dfll disabled . figure 33-56. 2mhz internal oscillator frequency vs. temperature. dfll enabled, from the 32.768khz internal oscillator . 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 temperature [c] frequency [mhz] 3.3v 3.0v 2.7v 2.2v 1.8v 3.3v 3.0v 2.7v 2.2v 1.8v 1.991 1.993 1.995 1.997 1.999 2.001 2.003 -45-35-25-15-5 5 1525354555657585 temperature [c] frequency [mhz]
113 8135l?avr?06/12 xmega d4 figure 33-57. 2mhz internal oscillator ca la calibration step size. v cc = 3v . 33.8.4 32mhz internal oscillator figure 33-58. 32mhz internal oscillator frequency vs. temperature. dfll disabled . 85c 25c -40c 0.15 0.17 0.19 0.21 0.23 0.25 0.27 0.29 0.31 0 102030405060708090100110120130 cala step size [%] 31.5 32.0 32.5 33.0 33.5 34.0 34.5 35.0 35.5 36.0 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 temperature [c] frequency [mhz] 3.3v 3.0v 2.7v 2.2v 1.8v
114 8135l?avr?06/12 xmega d4 figure 33-59. 32mhz internal oscillator frequency vs. temperature. dfll enabled, from the 32.768khz internal oscillator . figure 33-60. 32mhz internal oscillator ca la calibration step size. v cc = 3.0v . 3.3v 3.0v 2.7v 2.2v 1.8v 31.76 31.78 31.80 31.82 31.84 31.86 31.88 31.90 31.92 31.94 31.96 31.98 32.00 -45 -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 temperature [c] frequency [mhz] 85c 25c -40c 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128 cala step size [%]
115 8135l?avr?06/12 xmega d4 figure 33-61. 32mhz internal oscilla tor frequency vs. calb calibration value. v cc = 3.0v . 33.8.5 32mhz internal oscillator calibrated to 48mhz figure 33-62. 48mhz internal oscillator frequency vs. temperature. dfll disabled. 85c 25c -40c 25 30 35 40 45 50 55 60 65 70 75 0 7 14 21 28 35 42 49 56 63 calb frequency [mhz] 47 48 49 50 51 52 53 54 -45-35-25-15-5 5 1525354555657585 temperature [c] frequency [mhz] 3.3v 3.0v 2.7v 2.2v 1.8v
116 8135l?avr?06/12 xmega d4 figure 33-63. 48mhz internal oscillator frequency vs. temperature. dfll enabled, from the 32.768khz internal oscillator . figure 33-64. 48mhz internal oscillator ca la calibration step size. v cc = 3.0v . 47.70 47.75 47.80 47.85 47.90 47.95 48.00 48.05 -45-35-25-15-5 5 1525354555657585 temperature [c] frequency [mhz] 3.3v 3.0v 2.7v 2.2v 1.8v 85c 25c -40c 0.11 0.14 0.17 0.20 0.23 0.26 0.29 0.32 0.35 0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128 cala step size [%]
117 8135l?avr?06/12 xmega d4 33.9 two-wire interface characteristics figure 33-65. sda hold time vs. temperature. figure 33-66. sda hold time vs. supply voltage. 3 2 1 0 50 100 150 200 250 300 350 400 450 500 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 temperature [c] hold time [ns] 3 2 1 0 50 100 150 200 250 300 350 400 450 500 v cc [v] hold time [ns] 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6
118 8135l?avr?06/12 xmega d4 33.10 pdi characteristics figure 33-67. maximum pdi frequency vs. v cc . 85c 25c -40c 12 14 16 18 20 22 24 26 28 30 32 1.61.82.0 2.22.42.62.83.03.23.43.6 v cc [v] f max [mhz]
119 8135l?avr?06/12 xmega d4 34. errata 34.1 atxmega16d4, atxmega32d4 34.1.1 rev. e ? adc propagation delay is not correct when gain is used ? crc fails for range crc when end address is th e last word address of a flash section ? awex fault protection restore is not do ne correct in pattern generation mode 1. adc propagation delay is not correct when gain is used the propagation delay will increa se by only one adc clock cycle for all gain setting. problem fix/workaround none. 2. crc fails for range crc when end address is the last word address of a flash section if boot read lock is enabled, the range crc cannot end on the last address of the application section. if application table read lock is enabled, the range crc cannot end on the last address before the application table. problem fix/workaround ensure that the end address us ed in range crc does not end at the last address before a section with read lock enabled. instead, use the dedicated crc commands for complete applications sections. 3. awex fault protection restore is not done correctly in pattern generation mode when a fault is detected the outoven register is cleared, and when fault condition is cleared, outoven is restored according to the corresponding enabled dti channels. for common waveform channel mode (cwcm), this has no effect as the outoven is correct after restoring from fault. for pattern generation mode (pgm), outoven should instead have been restored according to the dtilsbuf register. problem fix/workaround for cwcm no workaround is required. for pgm in latched mode, disable the dti c hannels before returning from the fault condi- tion. then, set correct outoven value and enable the dti channels, before the direction (dir) register is written to enable the correct outputs again. for pgm in cycle-by-cycle mode there is no workaround. 4. erroneous interrupt when us ing timer/counter with qdec when the timer/counter is set in dual slope mode with qdec enabled, an additional underflow interrupt (and event) will be given when the counter coun ts from bottom to one. problem fix/workaround when receiving underflow interrupt check direction and value of counter. if direction is up and counter value is zero, chan ge the counter value to one. this will also remove the addi- tional event. if the counter value is above zero, clear the interrupt flag. 34.1.2 rev. c/d not sampled.
120 8135l?avr?06/12 xmega d4 34.1.3 rev. a/b ? bandgap voltage input for the acs can not be ch anged when used for both acs simultaneously ? vcc voltage scaler for ac is non-linear ? adc gain stage cannot be used for single conversion ? adc has increased inl error for some operating conditions ? adc gain stage output range is limited to 2.4 v ? adc event on compare match non-functional ? adc propagation delay is not correct when 8x -64x gain is used ? bandgap measurement with the adc is no n-functional when vcc is below 2.7v ? accuracy lost on first th ree samples after switching input to adc gain stage ? configuration of pgm and cwcm not as described in xmega d manual ? pwm is not restarted properly afte r a fault in cycle-by-cycle mode ? bod: bod will be enabled at any reset ? sampled bod in active mode will cause no ise when bandgap is used as reference ? eeprom page buffer always written when nvm data0 is written ? pending full asynchronous pin change interrupts will not wake the device ? pin configuration does not aff ect analog comparator output ? nmi flag for crystal oscillator failure automatically cleared ? flash power reduction mode can no t be enabled when entering sleep ? crystal start-up time required after powe r-save even if crystal is source for rtc ? rtc counter value not correctly read after sleep ? pending asynchronous rtc-interrupts will not wake up device ? twi transmit collision flag no t cleared on repeated start ? clearing twi stop interrupt flag may lock the bus ? twi start condition at bus timeout will cause transaction to be dropped ? twi data interrupt flag (dif) erroneously read as set ? wdr instruction inside closed window will not issue reset ? inverted i/o enable does not af fect analog comparator output ? twie is not available ? crc generator module is not available ? adc 1/x gain setting and vcc/2 re ference setting is not available ? tosc alternate pin locations is not available ? twi sdahold time configuration is not available ? timer/counter 2 is not available ? hires+ option is not available ? alternate pin locations for digita l peripherals are not available ? xoscpwr high drive option for ex ternal crystal is not available ? pll divide by two option is not available ? real time counter non-prescaled 32 khz clock options are not available ? pll lock detection failure function is not available ? non available functions and options 1. bandgap voltage input for the acs cannot be changed when used for both acs simultaneously
121 8135l?avr?06/12 xmega d4 if the bandgap voltage is selected as input for one analog comparator (ac) and then selected/deselected as input for another ac, the first comparator will be affected for up to 1 s and could potentially give a wrong comparison result. problem fix/workaround if the bandgap is required for both acs simultaneously, configure the input selection for both acs before enabling any of them. 2. vcc voltage scaler for ac is non-linear the 6-bit vcc voltage scaler in the analog comparators is non-linear. figure 34-1. analog comparator voltage scaler vs. scalefac. t = 25c. problem fix/workaround use external voltage input for the analog comparator if accurate voltage levels are needed 3. adc gain stage cannot be used for single conversion the adc gain stage will no t output correct result for singl e conversion that is triggered and started from software or event system. problem fix/workaround when the gain stage is used, the adc must be set in free running mode for correct results. 4. adc has increased inl error for some operating conditions some adc configurations or operating co ndition will result in increased inl error. in signed mode inl is increased to: ? 6lsb for sample rates above 130ksps, and up to 8lsb for 200ksps sample rate. ? 6lsb for reference voltage below 1.1v when vcc is above 3.0v. ? 20lsb for ambient temperature below 0 degree c and reference voltage below 1.3v. in unsigned mode, the inl error cannot be guaranteed, and this mode should not be used. problem fix/workaround 3.3v 2.7v 1.8v 0 0.5 1 1.5 2 2.5 3 3.5 0 5 10 15 20 25 30 35 40 45 50 55 60 65 scalefac v scale [v]
122 8135l?avr?06/12 xmega d4 none, avoid using the adc in the above configurations in order to prevent increased inl error. use the adc in signed mode also for single ended measurements. 5. adc gain stage output range is limited to 2.4v the amplified output of the adc gain stage will never go abov e 2.4v, hence the differential input will only give correct output when below 2.4v/gain. for th e available gain settings, this gives a differential input range of: problem fix/workaround keep the amplified voltage output from the adc gain stage below 2.4v in order to get a cor- rect result, or keep adc voltage reference below 2.4v. 6. adc event on compare match non-functional adc signalling event will be given at every conversion complete even if interr upt mode (int- mode) is set to below or above. problem fix/workaround enable and use interrupt on compare match when using the compare function. 7. adc propagation delay is not correct when 8x -64x gain is used the propagation dela y will increase by only one adc cloc k cycle for 8x and 16x gain setting, and 32x and 64x gain settings. problem fix/workaround none 8. bandgap measurement with the adc is non-functional when vcc is below 2.7v the adc can not be used to do bandgap measurements when vcc is below 2.7v. problem fix/workaround none. 9. accuracy lost on first three samples after switching input to adc gain stage due to memory effect in the adc gain stage, the first three samples after changing input channel must be disregarded to achieve 12-bit accuracy. problem fix/workaround run three adc conversions and discard these results after changing input channels to adc gain stage. ? 1x gain: 2.4 v ? 2x gain: 1.2 v ? 4x gain: 0.6 v ? 8x gain: 300 mv ? 16x gain: 150 mv ? 32x gain: 75 mv ? 64x gain: 38 mv
123 8135l?avr?06/12 xmega d4 10. configuration of pgm and cwcm not as described in xmega d manual enabling common waveform channel mode will enable pattern generation mode (pgm), but not common waveform channel mode. enabling pattern generation mode (pgm) and not common waveform channel mode (cwcm) will enable both patter n generation mode and comm on waveform channel mode. problem fix/workaround 11. pwm is not restarted properly after a fault in cycle-by-cycle mode when the awex fault restore mode is set to cycle-by-cycle, the waveform output will not return to normal operation at first update after fault condition is no longer present. problem fix/workaround do a write to any awex i/o register to re-enable the output. 12. bod will be enabled after any reset if any reset source go es active, the bod will be enabled and keep the device in reset if the vcc voltage is below the prog rammed bod level. during powe r-on reset, reset will not be released until vcc is above the programmed bod level even if the bod is disabled. problem fix/workaround do not set the bod level higher than vcc even if the bod is not used. 13. sampled bod in active mode will cause noise when bandgap is used as reference using the bod in sample d mode when the device is runnin g in active or idle mode will add noise on the bandgap reference for adc and analog comparator. problem fix/workaround if the bandgap is used as reference for eith er the adc or the analog comparator, the bod must not be set in sampled mode. 14. eeprom page buffer always written when nvm data0 is written if the eeprom is memory mapp ed, writing to nvm data0 will corrupt data in the eeprom page buffer. problem fix/workaround before writing to nvm data0, for exampl e when doing software crc or flash page buffer write, check if eeprom page buff er active loading flag (eeloa d) is set. do not write nvm data0 when eeload is set. 15. pending full asynchronous pin change interrupts will not wake the device any full asynchronous pin-change interrupt from pin 2, on any port, that is pending when the sleep instruction is executed, will be ignor ed until the device is woken from another source or the source triggers again. this applies w hen entering all sleep modes where the system clock is stopped. table 34-1. configure pwm and cwcm according to this table: pgm cwcm description 0 0 pgm and cwcm disabled 0 1 pgm enabled 1 0 pgm and cwcm enabled 1 1 pgm enabled
124 8135l?avr?06/12 xmega d4 problem fix/workaround none. 16. pin configuration does not affect analog comparator output the output/pull and inverted pin configuration does not affect the analog comparator output. problem fix/workaround none for output/pull configuration. for inverted i/o, configure the analog comparator to give an inverted result (i.e. connect positive input to the negative ac input and vice versa), or use and external inverter to change polarity of analog comparator output. 17. nmi flag for crystal oscillator failure automatically cleared nmi flag for crystal oscillator failure (xoscf dif) will be automatically cleared when exe- cuting the nmi interrupt handler. problem fix/workaround this device revision has only one nmi interrupt source, so checking the interrupt source in software is not required. 18. flash power reduction mode can not be enabled when entering sleep if flash power reduction mode is enabled when entering power-save or extended standby sleep mode, the device will only wake up on every fourth wake -up request. if flash power reduction mode is enabled wh en entering idle sleep mode, th e wake-up time will vary with up to 16 cpu clock cycles. problem fix/workaround disable flash power reduction mode before entering sleep mode. 19. crystal start-up time required after power-save even if crystal is source for rtc even if 32.768khz crystal is us ed for rtc during sleep, the cl ock from the crystal will not be ready for the system before th e specified start-up time. see "xoscsel[3:0]: crystal oscilla- tor selection" in xmega d manual. if bod is used in active mode, the bod will be on during this period (0.5s). problem fix/workaround if faster start-up is required , go to sleep with internal oscillator as system clock. 20. rtc counter value not correctly read after sleep if the rtc is set to wake up the device on rt c overflow and bit 0 of rtc cnt is identical to bit 0 of rtc per as the device is entering sleep, the value in the rtc count register can not be read correctly within the first prescaled rtc clock cycle after wakeup. the value read will be the same as the value in the register when entering sleep. the same applies if rtc compare match is used as wake-up source. problem fix/workaround wait at least one prescaled rtc clock cycle before reading the rtc cnt value. 21. pending asynchronous rtc-inte rrupts will not wa ke up device asynchronous interrupts from the real-time-counter that is pending when the sleep instruction is executed, will be ignored until the device is woken from another source or the source triggers again.
125 8135l?avr?06/12 xmega d4 problem fix/workaround none. 22. twi transmit collision flag not cleared on repeated start the twi transmit collision flag should be automatically cleared on start and repeated start, but is only cleared on start. problem fix/workaround clear the flag in software after address interrupt. 23. clearing twi stop interrupt flag may lock the bus if software clears the stop interrupt flag (apif) on the same peripheral clock cycle as the hardware sets this flag due to a new address received, clkhold is not cleared and the scl line is not released. this will lock the bus. problem fix/workaround check if the bus state is idle. if this is the case, it is safe to clear apif. if the bus state is not idle, wait for the scl pin to be low before clearing apif. code: /* only clear the interrupt flag if within a "safe zone". */ while ( /* bus not idle: */ ((comms_twi.master.status & twi_master_busstate_gm) != twi_master_busstate_idle_gc)) && /* scl not held by slave: */ !(comms_twi.slave.status & twi_slave_clkhold_bm) ) { /* ensure that the scl line is low */ if ( !(comms_port.in & pin1_bm) ) if ( !(comms_port.in & pin1_bm) ) break; } /* check for an pending address match interrupt */ if ( !(comms_twi.slave.status & twi_slave_clkhold_bm) ) { /* safely clear interrupt flag */ comms_twi.slave.status |= (uint8_t)twi_slave_apif_bm; } 24. twi start condition at bus timeout will cause transaction to be dropped if bus timeout is enabled and a timeout occurs on the same peripheral clock cycle as a start is detected, the tr ansaction will be dropped. problem fix/workaround none. 25. twi data interrupt flag erroneously read as set when issuing the twi slave response command cmd=0b11, it takes one peripheral clock cycle to clear the data interrupt flag (dif). a read of dif directly after issuing the command will show the dif still set.
126 8135l?avr?06/12 xmega d4 problem fix/workaround add one nop instruction before checking dif. 26. wdr instruction inside closed window will not issue reset when a wdr instruction is execute within one ulp clock cycle after updating the window control register, the counter can be cleared without giving a system reset. problem fix/workaround wait at least one ulp clock cycle before executing a wdr instruction. 28. inverted i/o enable does not affect analog comparator output the inverted i/o pin function does not affect the analog comparator output function problem fix/workaround configure the analog comparator setup to give an inverted result, or use an external inverter to change polarity of analog comparator output. 29. non available functions and options the below function and options are not available. writing to any registers or fuse to try and enable or configure t hese functions or options will have no effect, and will be as writing to a reserved address location. ?twie, the twi module on porte ?twi sdahold option in the twi ctrl register is one bit ?crc generator module ?adc 1/2x gain option, and this configuration option in the gain bits in the adc channel ctrl register ?adc v cc /2 reference option and this configuration option in the refsel bits on the adc refctrl register ?adc option to use internal gnd as negative input in differential measurements and this configuration option in the muxneg bits in the adc channel muxctrl register ?adc channel scan and the adc scan register ?adc current limitation option, and the cu rrlimit bits in the adc ctrlb register ?adc impedance mode selection for the gain stage, and the impmode bit in the adc ctrlb register ?timer/counter 2 and the splitmode configuration option in the bytem bits in the timer/counter 0 ctrle register ?analog comparator (ac) cu rrent output optio n, and the ac currctrl and currcalib registers ?port remap functions with alternate pin locations for timer/counter output compare channels, usart0 and spi, and the port remap register ?port rtc clock output option and the rtcout bit in the port clkevout register ?port remap functions with alternate pin locations for the clock and event output, and the clkevpin bit in the port clkevout register ?tosc alternate pin locations, and toscsel bit in fusebyte2 ?real time counter clock source options of external clock from tosc1, and 32.768khz from tosc, and 32.768khz from the 32.768khz inte rnal oscillator, and these configuration options in the rtcsrc bits in the clock rtctrl register
127 8135l?avr?06/12 xmega d4 ?pll divide by two option, and the plldiv bit in the clock pllctrl register ?pll lock detection failure function and the plldif and pllfden bits in the clock xoscfail register ?the high drive option for external crys tal and the xoscpwr bit on the oscillator xoscctrl register ?the option to enable sequential startup of the analog modules and the anainit register in mcu control memory problem fix/workaround none.
128 8135l?avr?06/12 xmega d4 35. datasheet revision history please note that the referring page numbers in th is section are referred to this document. the referring revision in this section are referring to the document revision. 35.1 8135l ? 06/12 35.2 8135k ? 06/12 35.3 8135j ? 12/10 35.4 8135i ? 10/10 35.5 8135h ? 09/10 1. editing updates. 2. updated all tables in the chapter ?electrical characteristics? on page 64 . 3. added new ?typical characteristics? on page 85 . 4. added new errata ?rev. e? on page 119. 5. added new errata on ?rev. a/b? on page 120: non available functions and options 1. atxmega64d4-cu is added in ?ordering information? on page 2 1. datasheet status changed to complete: preliminary removed from the front page. 2. updated all tables in the ?electrical characteristics? . 3. replaced table 31-11 on page 64 4. replaced table 31-17 on page 65 and added the figure ?tosc input capacitance? on page 66 5. updated errata adc (adc has increased inl for some operating conditions). 6. updated errata ?rev. a/b? on page 133 with twie (twie is not available). 7. updated the last page with atmel new brand style guide. 1. updated table 31-1 on page 58 . 1. updated ?errata? on page 90 .
129 8135l?avr?06/12 xmega d4 35.6 8135g ? 08/10 35.7 8135f ? 02/10 35.8 8135e ? 02/10 35.9 8135d ? 12/09 1. updated the footnote 3 of ?ordering information? on page 2 . 2. all references to crc removed. updated figure 3-1 on page 7 . 3. updated ?features? on page 26 . event channel 0 output on port pin 7. 4. updated ?dc characteristics? on page 58 by adding icc for flash/eeprom programming. 5. added avcc in ?adc characteristics? on page 62 . 6. updated start up time in ?adc characteristics? on page 62 . 7. updated and fixed typo in ?errata? section. 1. added ?pdi speed? on page 89 . 1. updated the device pin-out figure 2-1 on page 3 . pdi_clk and pdi_data renamed only pdi. 2. updated table 7-3 on page 18 . no of pages for atxmega32d4: 32 3. updated ?alternate port functions? on page 29 . 4. updated ?adc - 12-bit analog to digital converter? on page 39 . 5. updated figure 25-1 on page 50 . 6. updated ?alternate pin functions? on page 48 . 7. updated ?timer/counter and awex functions? on page 46 . 8. added table 31-17 on page 65 . 9. added table 31-18 on page 66 . 10. changed internal oscillator speed to ?oscillators and wake-up time? on page 85 . 11. updated ?errata? on page 90 . 1. added atxmega128d4 device and updated the datasheet accordingly. 2. updated ?electrical characteristics? on page 58 with max/min numbers. 3. added ?flash and eeprom memory characteristics? on page 61 . 4. updated table 31-10 on page 64 , input hysteresis is in v and not in mv. 5. added ?errata? on page 90 .
130 8135l?avr?06/12 xmega d4 35.10 8135c ? 10/09 35.11 8135b ? 09/09 35.12 8135a ? 03/09 1. updated ?features? on page 1 with two two-wire interfaces. 2. updated ?block diagram and qfn/tqfp pinout? on page 3 . 3. updated ?overview? on page 5 . 4. updated ?xmega d4 block diagram? on page 7 . 5. updated table 13-1 on page 24 . 6. updated ?overview? on page 35 . 7. updated table 27-5 on page 49 . 8. updated ?peripheral module address map? on page 50 . 1. added ?electrical characteri stics? on page 58 . 2. added ?typical characteristics? on page 67 . 1. initial revision.
i 8135l?avr?06/12 xmega d4 table of contents features ................ ................ .............. ............... .............. .............. ............ 1 1 ordering information .......... .............. ............... .............. .............. ............ 2 2 pinout/block diagram ......... .............. ............... .............. .............. ............ 3 3 overview ............ ................ ................ ............... .............. .............. ............ 5 3.1 block diagram ...................................................................................................6 4 resources .............. .............. .............. ............... .............. .............. ............ 7 4.1 recommended reading .....................................................................................7 5 capacitive touch sensing ................. ............... .............. .............. ............ 7 6 avr cpu ............ ................ ................ ............... .............. .............. ............ 8 6.1 features ............................................................................................................8 6.2 overview ............................................................................................................8 6.3 architectural overview .......................................................................................8 6.4 alu - arithmetic logic unit ...............................................................................9 6.5 program flow ..................................................................................................10 6.6 status register ................................................................................................10 6.7 stack and stack pointer ..................................................................................10 6.8 register file ....................................................................................................11 7 memories ............... .............. .............. ............... .............. .............. .......... 12 7.1 features ..........................................................................................................12 7.2 overview ..........................................................................................................12 7.3 flash program memory ...................................................................................13 7.4 fuses and lock bits .........................................................................................14 7.5 data memory ...................................................................................................15 7.6 eeprom ............... ................ ................ ................ ................ ................ ..........15 7.7 i/o memory ......................................................................................................15 7.8 data memory and bus arbitration ...................................................................16 7.9 memory timing ................................................................................................16 7.10 device id and revision ...................................................................................16 7.11 i/o memory protection .....................................................................................16 7.12 flash and eeprom page size ............. ................ ................ ................ ..........16 8 event system ........ .............. .............. ............... .............. .............. .......... 18 8.1 features ..........................................................................................................18
ii 8135l?avr?06/12 xmega d4 8.2 overview ..........................................................................................................18 9 system clock and clock options ................ ................. .............. .......... 20 9.1 features ..........................................................................................................20 9.2 overview ..........................................................................................................20 9.3 clock sources .................................................................................................21 10 power management and sleep modes ........ ................. .............. .......... 23 10.1 features ..........................................................................................................23 10.2 overview ..........................................................................................................23 10.3 sleep modes ....................................................................................................23 11 system control and reset .... .............. .............. .............. .............. ........ 25 11.1 features ..........................................................................................................25 11.2 overview ..........................................................................................................25 11.3 reset sequence ..............................................................................................25 11.4 reset sources .................................................................................................26 12 wdt ? watchdog timer ......... .............. .............. .............. .............. ........ 27 12.1 features ..........................................................................................................27 12.2 overview ..........................................................................................................27 13 interrupts and programmabl e multilevel interrupt c ontroller ........... 28 13.1 features ..........................................................................................................28 13.2 overview ..........................................................................................................28 13.3 interrupt vectors ...............................................................................................28 14 i/o ports ............... ................ .............. ............... .............. .............. .......... 30 14.1 features ..........................................................................................................30 14.2 overview ..........................................................................................................30 14.3 output driver ...................................................................................................31 14.4 input sensing ...................................................................................................33 14.5 alternate port functions ..................................................................................33 15 tc0/1 ? 16-bit timer/count er type 0 and 1 ..... .............. .............. ........ 34 15.1 features ..........................................................................................................34 15.2 overview ..........................................................................................................34 16 tc2 - timer/counter type 2 .. .............. .............. .............. .............. ........ 36 16.1 features ..........................................................................................................36 16.2 overview ..........................................................................................................36
iii 8135l?avr?06/12 xmega d4 17 awex ? advanced waveform ex tension ........... .............. ............ ........ 37 17.1 features ..........................................................................................................37 17.2 overview ..........................................................................................................37 18 hi-res ? high resolut ion extension ......... ................ ................. .......... 38 18.1 features ..........................................................................................................38 18.2 overview ..........................................................................................................38 19 rtc ? 16-bit real-time counter ............. ................. ................ ............. 39 19.1 features ..........................................................................................................39 19.2 overview ..........................................................................................................39 20 twi ? two-wire interface ... .............. ............... .............. .............. .......... 40 20.1 features ..........................................................................................................40 20.2 overview ..........................................................................................................40 21 spi ? serial peripheral interface ........... .............. .............. ............ ........ 42 21.1 features ..........................................................................................................42 21.2 overview ..........................................................................................................42 22 usart ............. ................. ................ ................. .............. .............. .......... 43 22.1 features ..........................................................................................................43 22.2 overview ..........................................................................................................43 23 ircom ? ir communication module ......... ................ ................. .......... 44 23.1 features ..........................................................................................................44 23.2 overview ..........................................................................................................44 24 crc ? cyclic redundancy che ck generator .............. .............. .......... 45 24.1 features ..........................................................................................................45 24.2 overview ..........................................................................................................45 25 adc ? 12-bit analog to digi tal converter ............... ................ ............. 46 25.1 features ..........................................................................................................46 25.2 overview ..........................................................................................................46 26 ac ? analog comparator ... .............. ............... .............. .............. .......... 48 26.1 features ..........................................................................................................48 26.2 overview ..........................................................................................................48 27 programming and debugging ..... ................ ................. .............. .......... 50 27.1 features ..........................................................................................................50 27.2 overview ..........................................................................................................50
iv 8135l?avr?06/12 xmega d4 28 pinout and pin functions ................. ............... .............. .............. .......... 51 28.1 alternate pin function description ..................................................................51 28.2 alternate pin functions ...................................................................................53 29 peripheral module addr ess map ............... ................ ................. .......... 56 30 instruction set summary ... .............. ............... .............. .............. .......... 57 31 packaging information .......... .............. .............. .............. .............. ........ 61 31.1 44a ..................................................................................................................61 31.2 44m1 ................................................................................................................62 31.3 49c2 ................................................................................................................63 32 electrical characteristics ... .............. ............... .............. .............. .......... 64 32.1 absolute maximum ratings .............................................................................64 32.2 general operating ratings ..............................................................................64 32.3 current consumption .......................................................................................66 32.4 wake-up time from sleep modes .....................................................................68 32.5 i/o pin characteristics .....................................................................................69 32.6 adc characteristics ........................................................................................70 32.7 analog comparator characteristics .................................................................72 32.8 bandgap and internal 1.0v reference characteristics ...................................72 32.9 brownout detection characteristics ................................................................73 32.10 external reset characteristics ........................................................................73 32.11 power-on reset characteristics ......................................................................73 32.12 flash and eeprom memory characteri stics .......... ................ ............. ..........74 32.13 clock and oscillator characteristics ................................................................75 32.14 spi characteristics ..........................................................................................81 32.15 two-wire interface characteristics .................................................................83 33 typical characteristics ....... .............. ............... .............. .............. .......... 85 33.1 current consumption .......................................................................................85 33.2 i/o pin characteristics .....................................................................................95 33.3 analog comparator characteristics ...............................................................102 33.4 internal 1.0v reference characteristics .........................................................105 33.5 bod characteristics ......................................................................................105 33.6 external reset characteristics ......................................................................106 33.7 power-on reset characteristics ....................................................................109 33.8 oscillator characteristics ...............................................................................110
33.9 two-wire interface characteristics ................................................................117 33.10 pdi characteristics .........................................................................................118 34 errata ........... ................ ................ ................. ................ .............. ........... 119 34.1 atxmega16d4, atxmega32d4 .....................................................................119 35 datasheet revision history .. ................ ................. ................ ............. 128 35.1 8135l ? 06/12 ................................................................................................128 35.2 8135k ? 06/12 ...............................................................................................128 35.3 8135j ? 12/10 ................................................................................................128 35.4 8135i ? 10/10 .................................................................................................128 35.5 8135h ? 09/10 ...............................................................................................128 35.6 8135g ? 08/10 ...............................................................................................129 35.7 8135f ? 02/10 ...............................................................................................129 35.8 8135e ? 02/10 ...............................................................................................129 35.9 8135d ? 12/09 ...............................................................................................129 35.10 8135c ? 10/09 ...............................................................................................130 35.11 8135b ? 09/09 ...............................................................................................130 35.12 8135a ? 03/09 ...............................................................................................130 table of contents.......... ................. ................ ................. ................ ........... i
8135l?avr?06/12 atmel corporation 2325 orchard parkway san jose, ca 95131 usa tel : (+1)(408) 441-0311 fax : (+1)(408) 487-2600 www.atmel.com atmel asia limited unit 1-5 & 16, 19/f bea tower, millennium city 5 418 kwun tong road kwun tong, kowloon hong kong tel : (+852) 2245-6100 fax : (+852) 2722-1369 atmel munich gmbh business campus parkring 4 d-85748 garching b. munich germany tel : (+49) 89-31970-0 fax : (+49) 89-3194621 atmel japan 16f, shin osaki kangyo bldg. 1-6-4 osaki shinagawa-ku tokyo 104-0032 japan tel : (+81) 3-6417-0300 fax : (+81) 3-6417-0370 ? 2012 atmel corporation. all rights reserved. atmel ? , atmel logo and combinations thereof, avr ? , qtouch ? , qmatrix ? , avr studio ? and others are registered trademarks or trade- marks of atmel corporation or its subsidiaries. windows ? and others are registered trademarks of microsoft corporation in u.s. and other countries. other terms and product names may be trademarks of others. disclaimer: the information in this document is provided in connection wi th atmel products. no license, ex press or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of atmel products. except as set forth in the atmel terms and conditions of sales located on the atmel website, atmel assumes no liability whatsoever and disclaims any express, implied or statutory warranty relating to its pro ducts including, but not limited to, the implied warranty of merchantability, fitness for a particular purp ose, or non-infringement. in no even t shall atmel be liable for any direct, indirect, consequential, punitive, special or incidental damages (including, without limitati on, damages for loss and prof- its, business interruption, or loss of information) arising out of the use or inability to use this document, even if atmel has been advised of the possibility of such damages. atmel makes no representations or warranties with respect to the accuracy or com- pleteness of the contents of th is document and reserves the right to make changes to specifications and product descriptions at any time without notice. atmel does not make any commitment to update the information cont ained herein. unless specifically provided otherwise, atmel pr oducts are not suit- able for, and shall not be used in, automotive applications. atme l products are not intended, authorized, or warranted for use as components in applica- tions intended to support or sustain life.


▲Up To Search▲   

 
Price & Availability of ATXMEGA32D4-CU

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X